/* ============================================
   SEO Audit Platform - Clean Professional Theme
   Simple, Organized, Enterprise-Ready
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #16a34a;
    --warning: #ea580c;
    --danger: #dc2626;
    --info: #0ea5e9;
    
    /* Neutral Colors */
    --text-dark: #1f2937;
    --text-gray: #4b5563;
    --text-light: #6b7280;
    --bg-white: #ffffff;
    --bg-light: #f3f4f6;
    --bg-lighter: #f9fafb;
    --border: #e5e7eb;
    
    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Transitions */
    --transition: all 0.2s ease-in-out;
}

/* Light Mode Default */
html {
    color-scheme: light;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* Content wrapper */
.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

header {
    padding: var(--spacing-xl) 0;
    text-align: center;
    margin-bottom: var(--spacing-xl);
    border-bottom: 2px solid var(--border);
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
}

.header-content p {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0;
    font-weight: 400;
}

/* ============================================
   MAIN FORM & INPUT SECTION
   ============================================ */

.audit-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.input-group {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    align-items: flex-end;
}

.input-wrapper {
    flex: 1;
    min-width: 250px;
}

.input-wrapper label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.input-wrapper input {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-dark);
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: var(--transition);
}

.input-wrapper input::placeholder {
    color: var(--text-light);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    min-width: 140px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-light);
    border: 1px solid var(--border);
    color: var(--text-dark);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   LOADING STATE
   ============================================ */

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(37, 99, 235, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   REPORT SECTION
   ============================================ */

.report-container {
    display: none;
}

.report-container.visible {
    display: block;
}

.report-header {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.report-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-dark);
}

.report-url {
    font-size: 0.9rem;
    color: var(--text-gray);
    word-break: break-all;
    font-family: var(--font-mono);
    background: var(--bg-lighter);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary);
}

/* ============================================
   REPORT BLOCKS (CRITICAL)
   ============================================ */

.report-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.report-block {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.block-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-dark);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--border);
}

.block-section {
    margin-bottom: var(--spacing-lg);
}

.block-section:last-child {
    margin-bottom: 0;
}

.section-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--spacing-sm);
    display: block;
}

.section-content {
    font-size: 0.95rem;
    color: var(--text-gray);
    line-height: 1.8;
    background: var(--bg-lighter);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary);
}

.section-content strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* Status indicators */
.status-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: var(--spacing-sm);
}

.status-found {
    background: rgba(22, 163, 74, 0.1);
    color: var(--success);
    border: 1px solid rgba(22, 163, 74, 0.3);
}

.status-missing {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.status-warning {
    background: rgba(234, 88, 12, 0.1);
    color: var(--warning);
    border: 1px solid rgba(234, 88, 12, 0.3);
}

/* Social media links display */
.social-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.social-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-lighter);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    border-left: 3px solid var(--border);
}

.social-item.found {
    border-left-color: var(--success);
    background: rgba(22, 163, 74, 0.05);
}

.social-item.missing {
    border-left-color: var(--danger);
}

.social-status {
    font-weight: 600;
    font-size: 0.8rem;
}

/* ============================================
   ERROR & SUCCESS MESSAGES
   ============================================ */

.alert {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.alert.error {
    border-left: 4px solid var(--danger);
    background: rgba(220, 38, 38, 0.05);
}

.alert.success {
    border-left: 4px solid var(--success);
    background: rgba(22, 163, 74, 0.05);
}

.alert.info {
    border-left: 4px solid var(--info);
    background: rgba(14, 165, 233, 0.05);
}

.alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-message {
    color: var(--text-gray);
    font-size: 0.95rem;
}

/* ============================================
   PDF DOWNLOAD & ACTION BUTTONS
   ============================================ */

.action-buttons {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.action-buttons .btn {
    flex: 1;
    min-width: 150px;
}

.btn-download {
    background: var(--success);
    color: white;
}

.btn-download:hover:not(:disabled) {
    background: #15803d;
}

#pdf-section {
    display: none;
}

/* ============================================
   PERFORMANCE SCORE BLOCK
   ============================================ */

.performance-score {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary);
    margin: var(--spacing-md) 0;
}

.score-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding: var(--spacing-md);
    }

    .input-group {
        flex-direction: column;
    }

    .input-wrapper {
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .header-content h1 {
        font-size: 1.75rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.5rem;
    }

    .audit-card,
    .report-block,
    .alert {
        padding: var(--spacing-md);
    }

    .block-title {
        font-size: 1rem;
    }

    .report-title {
        font-size: 1.25rem;
    }

    .performance-score {
        font-size: 2rem;
    }
}

/* ============================================
   PRINT STYLES FOR PDF
   ============================================ */

@media print {
    body {
        background: white;
    }

    .audit-card,
    .report-header,
    .report-block,
    .alert {
        background: white;
        border: 1px solid #ddd;
        box-shadow: none;
        page-break-inside: avoid;
    }

    .report-block {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }

    .input-group,
    .action-buttons {
        display: none !important;
    }

    .container {
        max-width: 100%;
    }

    .report-container {
        display: block !important;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

.show {
    display: block !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-light);
}

.text-subtle {
    color: var(--text-light);
}