/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

/* Login page styles */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-form {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.login-form h1 {
    text-align: center;
    margin-bottom: 10px;
    color: #2d3748;
    font-size: 28px;
    font-weight: 700;
}

.subtitle {
    text-align: center;
    color: #718096;
    margin-bottom: 30px;
    font-size: 16px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #4a5568;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #5a67d8;
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-outline {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-info {
    margin-top: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
    font-size: 14px;
    color: #4a5568;
}

.login-info p {
    margin-bottom: 5px;
}

/* Dashboard styles */
.dashboard {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    padding: 16px 0;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.15);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: white;
    font-size: 22px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.last-update {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px;
}

.add-domain-section {
    background: white;
    padding: 16px 24px 12px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.add-domain-section h2 {
    margin-bottom: 12px;
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

.add-domain-form {
    display: flex;
    gap: 16px;
    align-items: center;
}

.add-domain-form .form-group {
    flex: 1;
    max-width: 400px;
    margin-bottom: 0;
}

.add-domain-form input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.add-domain-form input:focus {
    outline: none;
    border-color: #667eea;
}

.add-domain-form .btn {
    padding: 10px 20px;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.domains-section {
    background: white;
    padding: 20px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.section-header h2 {
    color: #2d3748;
    font-size: 18px;
    font-weight: 600;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat {
    text-align: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    min-width: 80px;
}

.stat-number {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.domains-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.domains-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: none;
}

.domains-table th:first-child {
    border-top-left-radius: 8px;
}

.domains-table th:last-child {
    border-top-right-radius: 8px;
}

.domains-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 13px;
    background: white;
}

.domains-table tbody tr:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.domains-table tbody tr {
    transition: all 0.2s ease;
}

.domains-table tr.valid {
    border-left: 6px solid #10b981;
}

.domains-table tr.invalid {
    border-left: 6px solid #ef4444;
}

.domains-table tr.warning {
    border-left: 6px solid #f59e0b;
}

.domain-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.domain-name::before {
    content: "🌐";
    margin-right: 6px;
    font-size: 12px;
}

.domain-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 6px;
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
}

.btn-secondary.btn-small {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary.btn-small:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.ssl-status-cell {
    text-align: center;
}

.ssl-date-cell {
    white-space: nowrap;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 11px;
    color: #64748b;
}

.ssl-issuer-cell {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #64748b;
}

.ssl-status-cell {
    text-align: center;
    padding: 12px 8px;
}

.domains-grid {
    /* Fallback for empty state */
    display: block;
}

.domain-card {
    /* Hide card styles when using table */
    display: none;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-valid {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.status-valid::before {
    background: rgba(255, 255, 255, 0.8);
}

.status-invalid {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.status-invalid::before {
    background: rgba(255, 255, 255, 0.8);
}

.status-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.status-warning::before {
    background: rgba(255, 255, 255, 0.8);
}

.text-success {
    color: #10b981 !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.text-success::before {
    content: "✓";
    margin-right: 4px;
    font-size: 12px;
}

.text-warning {
    color: #f59e0b !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.text-warning::before {
    content: "⚠";
    margin-right: 4px;
    font-size: 12px;
}

.text-danger {
    color: #ef4444 !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.text-danger::before {
    content: "✗";
    margin-right: 4px;
    font-size: 12px;
}

.message {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
}

.message.success {
    background: #c6f6d5;
    color: #22543d;
}

.message.error {
    background: #fed7d7;
    color: #742a2a;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none !important;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-overlay p {
    color: white;
    font-size: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .add-domain-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .add-domain-form .form-group {
        max-width: none;
    }
    
    .section-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .stats {
        justify-content: center;
    }
    
    .domains-table {
        font-size: 12px;
    }
    
    .domains-table th,
    .domains-table td {
        padding: 8px 4px;
    }
    
    .ssl-issuer-cell {
        max-width: 100px;
    }
    
    .domain-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .btn-small {
        font-size: 10px;
        padding: 4px 8px;
    }
}

@media (max-width: 1024px) {
    .domains-table th:nth-child(6),
    .domains-table td:nth-child(6) {
        display: none; /* Hide issuer column on medium screens */
    }
}

@media (max-width: 768px) {
    .domains-table th:nth-child(4),
    .domains-table td:nth-child(4),
    .domains-table th:nth-child(7),
    .domains-table td:nth-child(7) {
        display: none; /* Hide valid from and last checked columns on small screens */
    }
}