* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.header-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.header-actions .action-btn {
    min-width: 220px;
}

.audit-form {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.url-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.url-input:focus {
    outline: none;
    border-color: #667eea;
}

.audit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.audit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-spinner {
    animation: spin 1s linear infinite;
}

.example-urls {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.example-urls p {
    margin-bottom: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.example-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.example-btn {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.form-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.form-info p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.loading {
    display: none;
    text-align: center;
    padding: 2rem;
    color: white;
}

.spinner {
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-steps {
    margin-top: 2rem;
    text-align: left;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.step {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step.active {
    opacity: 1;
    background: rgba(255,255,255,0.2);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.score-overview {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    color: white;
}

.overall-score {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.score-label {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.score-description {
    font-size: 1rem;
    opacity: 0.8;
}

.audit-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.audit-section {
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.audit-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.section-score {
    background: #667eea;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
}

.section-score.excellent { background: #28a745; }
.section-score.good { background: #ffc107; color: #333; }
.section-score.needs-work { background: #dc3545; }
.section-score.unavailable { background: #6c757d; color: white; }

.check-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.check-item:hover {
    background: #f8f9fa;
}

.check-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.check-icon.pass {
    background: #28a745;
    color: white;
}

.check-icon.fail {
    background: #dc3545;
    color: white;
}

.check-icon.warning {
    background: #ffc107;
    color: #333;
}

.recommendations {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.recommendations h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.recommendation {
    background: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.recommendation h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.recommendation p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.recommendation.high {
    border-left-color: #dc3545;
}

.recommendation.medium {
    border-left-color: #ffc107;
}

.recommendation.low {
    border-left-color: #28a745;
}

.api-status {
    text-align: center;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.api-status.connected {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.api-status.disconnected {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}



.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.action-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.action-btn.secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.footer {
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    color: white;
    opacity: 0.8;
}

.footer-content {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 2rem;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .form-group {
        flex-direction: column;
    }
    
    .audit-sections {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

/* LLM Optimizer CTA */
.llm-optimizer-cta {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.llm-optimizer-cta p {
    color: white;
    font-size: 0.95rem;
    margin: 0;
}

.llm-optimizer-cta .cta-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.2s ease;
}

.llm-optimizer-cta .cta-btn:hover {
    opacity: 0.85;
}

/* Print / PDF export */
@media print {
    body {
        background: white;
        color: #333;
    }

    .header-actions,
    .audit-form,
    .loading,
    .actions,
    .footer,
    .llm-optimizer-cta {
        display: none !important;
    }

    .header {
        color: #333;
        margin-bottom: 1.5rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .container {
        padding: 0;
        max-width: 100%;
    }

    .results {
        display: block !important;
    }

    .score-overview {
        background: #f5f5f5;
        border: 1px solid #ddd;
        box-shadow: none;
        break-inside: avoid;
    }

    .overall-score {
        color: #333;
    }

    .audit-sections {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .audit-section {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    .recommendations {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    .recommendation {
        break-inside: avoid;
    }

    a[href]::after {
        content: none;
    }
}
