/* --- Variables et Bases --- */
:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-secondary: #334155;
    --primary: #22c55e;
    --primary-dark: #16a34a;
    --secondary: #3b82f6;
    --accent: #fbbf24;
    --text-head: #ffffff;
    --text-body: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-body);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Navigation --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.logo {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-body);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.nav-active::after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.nav-active {
    color: var(--primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-body);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* --- Hero Section --- */
.hero {
    padding: 6rem 5%;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #111827 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%2322c55e" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--text-head);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-head) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.hero .description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.stat {
    text-align: center;
    padding: 1.5rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.stat:hover {
    transform: translateY(-5px);
    background: rgba(34, 197, 94, 0.15);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Buttons --- */
.btn-main, .btn-secondary {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
}

.btn-main {
    background: var(--primary);
    color: var(--bg-main);
}

.btn-main:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(34, 197, 94, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-head);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Sections --- */
section {
    padding: 5rem 0;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: var(--text-head);
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 600;
}

/* --- Features Section --- */
.features {
    background: var(--bg-main);
}

.feature-card {
    text-align: center;
    padding: 2.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: block;
}

.feature-card h3 {
    color: var(--text-head);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.feature-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.card-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.card-link:hover {
    gap: 1rem;
    color: var(--primary-dark);
}

/* --- Showcase Section --- */
.showcase {
    background: linear-gradient(180deg, var(--bg-main) 0%, var(--bg-card) 100%);
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.showcase-item {
    padding: 2rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.showcase-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    background: rgba(30, 41, 59, 0.8);
}

.showcase-item h4 {
    color: var(--text-head);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.showcase-item p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* --- CTA Section --- */
.cta {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    text-align: center;
    position: relative;
}

.cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="2" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
}

.cta .container {
    position: relative;
    z-index: 1;
}

.cta h2 {
    color: var(--bg-main);
    margin-bottom: 1rem;
    font-size: 2.5rem;
}

.cta p {
    color: var(--bg-main);
    margin-bottom: 2rem;
    font-size: 1.2rem;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta .btn-main {
    background: var(--bg-main);
    color: var(--primary);
}

.cta .btn-main:hover {
    background: var(--text-head);
}

.cta .btn-secondary {
    background: transparent;
    color: var(--bg-main);
    border-color: var(--bg-main);
}

.cta .btn-secondary:hover {
    background: var(--bg-main);
    color: var(--primary);
}

/* --- Grid --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.card h3 {
    color: var(--primary);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.card p {
    color: var(--text-body);
    line-height: 1.6;
}

/* --- Footer --- */
footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--text-head);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section p {
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 2px solid var(--primary);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .showcase-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    section {
        padding: 3rem 0;
    }

    .hero {
        padding: 4rem 5%;
    }

    .card {
        padding: 1.5rem;
    }

    .feature-card {
        padding: 2rem 1.5rem;
    }
    
    .guides-grid,
    .management-grid {
        gap: 2rem;
    }
    
    .tool-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .tool-icon {
        margin: 0 auto;
    }
    
    .tool-features {
        justify-content: center;
    }
    
    .guide-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content > * {
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.2s; }
.hero-content > *:nth-child(3) { animation-delay: 0.3s; }
.hero-content > *:nth-child(4) { animation-delay: 0.4s; }

/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

/* --- Guides Page Styles --- */
.guides-intro {
    text-align: center;
    margin-bottom: 4rem;
}

.guides-grid {
    display: grid;
    gap: 3rem;
    margin-bottom: 4rem;
}

.guide-category {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.guide-category:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.category-header {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(59, 130, 246, 0.1));
    padding: 2rem;
    border-bottom: 1px solid var(--border);
}

.category-header h3 {
    color: var(--text-head);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.category-header p {
    color: var(--text-muted);
    margin: 0;
}

.guide-list {
    padding: 2rem;
}

.guide-item {
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.guide-item:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.guide-item:last-child {
    margin-bottom: 0;
}

.guide-item h4 {
    color: var(--text-head);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.guide-item p {
    color: var(--text-body);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.guide-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.difficulty {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.difficulty.facile {
    background: rgba(34, 197, 94, 0.2);
    color: var(--primary);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.difficulty.moyen {
    background: rgba(251, 191, 36, 0.2);
    color: var(--accent);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.difficulty.difficile {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.duration {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.duration::before {
    content: '⏱️';
}

.guide-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-link:hover {
    gap: 1rem;
    color: var(--primary-dark);
}

/* --- Management Page Styles --- */
.management-intro {
    text-align: center;
    margin-bottom: 4rem;
}

.management-grid {
    display: grid;
    gap: 3rem;
    margin-bottom: 4rem;
}

.tool-list {
    padding: 2rem;
}

.tool-item {
    padding: 2rem;
    margin-bottom: 1.5rem;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    align-items: start;
}

.tool-item:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.tool-item:last-child {
    margin-bottom: 0;
}

.tool-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.tool-content {
    flex: 1;
}

.tool-item h4 {
    color: var(--text-head);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.tool-item p {
    color: var(--text-body);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.tool-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tool-features span {
    background: rgba(59, 130, 246, 0.1);
    color: var(--secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.tool-status {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.available {
    background: rgba(34, 197, 94, 0.2);
    color: var(--primary);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-badge.beta {
    background: rgba(251, 191, 36, 0.2);
    color: var(--accent);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-badge.coming {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.tool-version {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-family: 'Consolas', monospace;
    background: var(--bg-card);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* --- Legacy Support --- */
.category-title {
    color: var(--text-head);
    border-left: 5px solid var(--primary);
    padding-left: 15px;
    margin-top: 40px;
    background: rgba(34, 197, 94, 0.1);
    padding-top: 10px;
    padding-bottom: 10px;
}

.config-tip {
    background: rgba(15, 23, 42, 0.6);
    padding: 10px;
    margin-top: 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--accent);
    border-left: 3px solid var(--accent);
}

/* --- AI Page Styles --- */
.ai-section {
    padding: 4rem 0;
}

.ai-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.ai-tab {
    padding: 0.75rem 2rem;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text-body);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 1rem;
}

.ai-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.ai-tab.active {
    background: var(--primary);
    color: var(--bg-main);
    border-color: var(--primary);
}

.ai-tab-content {
    display: none;
}

.ai-tab-content.active {
    display: block;
    animation: fadeInUp 0.5s ease;
}

/* --- Chat Styles --- */
.chat-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(59, 130, 246, 0.1));
    border-bottom: 1px solid var(--border);
}

.chat-header h3 {
    color: var(--text-head);
    margin: 0;
    font-size: 1.3rem;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background: var(--primary);
}

.status-indicator.offline {
    background: #dc2626;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--bg-main);
}

.message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.3s ease;
}

.message.ai-message {
    flex-direction: row;
}

.message.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--bg-main);
    border-color: var(--primary);
}

.message-content p {
    margin: 0;
    line-height: 1.5;
}

.message.error .message-content {
    background: rgba(220, 38, 38, 0.1);
    border-color: #dc2626;
    color: #fca5a5;
}

.chat-input-container {
    padding: 1.5rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

#chat-input {
    flex: 1;
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-body);
    padding: 0.75rem;
    border-radius: 8px;
    resize: vertical;
    min-height: 50px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#chat-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

#send-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.send-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

#send-message:hover .send-icon {
    transform: translateX(3px);
}

.chat-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.typing-indicator {
    color: var(--primary);
    font-style: italic;
}

/* --- Image Analysis Styles --- */
.image-analysis-container {
    max-width: 800px;
    margin: 0 auto;
}

.analysis-header {
    text-align: center;
    margin-bottom: 2rem;
}

.analysis-header h3 {
    color: var(--text-head);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.analysis-header p {
    color: var(--text-muted);
    margin: 0;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg-card);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(34, 197, 94, 0.05);
}

.upload-content h4 {
    color: var(--text-head);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.upload-content p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.upload-info {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.image-preview {
    margin-bottom: 2rem;
}

.preview-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

#preview-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
}

.preview-actions {
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.analysis-result {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.result-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(59, 130, 246, 0.1));
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-header h4 {
    color: var(--text-head);
    margin: 0;
    font-size: 1.2rem;
}

.result-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.result-content {
    padding: 1.5rem;
}

.analysis-text {
    background: var(--bg-main);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
    line-height: 1.6;
    color: var(--text-body);
}

.api-status {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
}

.api-status h4 {
    color: var(--text-head);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-main);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.status-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.status-value {
    color: var(--text-body);
    font-weight: 500;
}

/* --- API Key Modal Styles --- */
.api-key-btn {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.api-key-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--primary);
}

.api-key-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    color: var(--text-head);
    margin: 0;
    font-size: 1.3rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body p {
    color: var(--text-body);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-body .input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

#api-key-input {
    flex: 1;
    background: var(--bg-main);
    border: 1px solid var(--border);
    color: var(--text-body);
    padding: 0.75rem;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

#api-key-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.toggle-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-body);
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}

.key-info {
    background: rgba(59, 130, 246, 0.1);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--secondary);
}

.key-info p {
    color: var(--text-head);
    margin-bottom: 1rem;
    font-weight: 500;
}

.key-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.key-info li {
    color: var(--text-body);
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.key-info li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* --- Responsive Design for AI Page --- */
@media (max-width: 768px) {
    .ai-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .ai-tab {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
    
    .chat-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .chat-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .preview-actions {
        flex-direction: column;
    }
    
    .result-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
    }
}