/* ==========================================================================
   GLOBAL M3 TOKENS (Dechro Brand Colors x Pixel Aesthetic)
   ========================================================================== */
:root {
    /* Primary Colors (Deep Blue) */
    --md-sys-color-primary: #0a3a6a;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #d4e3ff;
    --md-sys-color-on-primary-container: #001c3a;
    
    /* Secondary Colors (Vibrant Red) */
    --md-sys-color-secondary: #d3222a;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-secondary-container: #ffdad6;
    --md-sys-color-on-secondary-container: #410002;
    
    /* Surface Colors (Pixel Light Theme) */
    --md-sys-color-surface: #fdfcff;
    --md-sys-color-on-surface: #1a1c1e;
    --md-sys-color-surface-container-low: #f3f3f7;
    --md-sys-color-surface-container: #ededf1;
    --md-sys-color-surface-container-high: #e7e8ec;

    /* Shapes */
    --md-sys-shape-corner-medium: 12px;
    --md-sys-shape-corner-large: 16px;
    --md-sys-shape-corner-extra-large: 28px;
    --md-sys-shape-corner-full: 9999px;

    /* Elevations */
    --md-sys-elevation-1: 0px 1px 3px 1px rgba(0,0,0,0.1), 0px 1px 2px 0px rgba(0,0,0,0.2);
    --md-sys-elevation-2: 0px 2px 6px 2px rgba(0,0,0,0.1), 0px 1px 2px 0px rgba(0,0,0,0.2);
    
    /* Motion / Animations (The Pixel "Butter" Curve) */
    --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
    --md-sys-motion-duration-medium: 400ms;
}

/* ==========================================================================
   MANUAL DARK MODE OVERRIDES (Pixel Night Mode)
   ========================================================================== */
body.dark-mode {
    --md-sys-color-surface: #111318;
    --md-sys-color-on-surface: #e2e2e9;
    --md-sys-color-surface-container-low: #1a1c22;
    --md-sys-color-surface-container: #202229;
    --md-sys-color-surface-container-high: #2a2c35;
    --md-sys-color-primary-container: #003366;
    --md-sys-color-on-primary-container: #d4e3ff;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; 
    background-color: var(--md-sys-color-surface); 
    color: var(--md-sys-color-on-surface); 
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.4s var(--md-sys-motion-easing-emphasized), 
                color 0.4s var(--md-sys-motion-easing-emphasized);
    -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

.material-symbols-rounded { vertical-align: middle; display: inline-block; }

/* Selection Color (Όταν μαρκάρεις κείμενο) */
::selection { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }

/* Global Scrollbar (Minimal Tech Style) */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--md-sys-color-surface); }
::-webkit-scrollbar-thumb { background: var(--md-sys-color-surface-container-high); border-radius: 8px; border: 2px solid var(--md-sys-color-surface); }
::-webkit-scrollbar-thumb:hover { background: var(--md-sys-color-outline); }

/* Global Typography */
.text-white { color: #ffffff !important; }
.headline-large { font-size: 32px; font-weight: 400; color: var(--md-sys-color-on-surface); margin-bottom: 8px; letter-spacing: -0.5px; }
.title-large { font-size: 22px; font-weight: 500; letter-spacing: -0.2px; }
.body-large { font-size: 16px; margin-bottom: 32px; color: var(--md-sys-color-on-surface); }
.body-medium { font-size: 14px; color: var(--md-sys-color-on-surface); opacity: 0.8; }
.display-large { font-size: 44px; line-height: 1.1; font-weight: 500; margin-bottom: 16px; letter-spacing: -1px; }

/* ==========================================================================
   HEADER, LOGO & BRANDING
   ========================================================================== */
.m3-top-app-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 24px; background-color: rgba(253, 252, 255, 0.9);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid var(--md-sys-color-surface-container-high);
    transition: background-color 0.4s var(--md-sys-motion-easing-emphasized);
}

body.dark-mode .m3-top-app-bar { background-color: rgba(17, 19, 24, 0.9); }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; border-radius: 16px; padding: 4px; transition: transform 0.2s; }
.brand:active { transform: scale(0.95); }
.brand-logo { height: 44px; width: auto; max-width: 100%; object-fit: contain; } 

.brand-name {
    font-size: 22px; font-weight: 700; letter-spacing: -0.5px;
    color: var(--md-sys-color-primary); transition: color 0.4s ease;
}

body.dark-mode .brand-name { color: var(--md-sys-color-on-surface); }
body.dark-mode .brand-logo { filter: drop-shadow(0px 0px 4px rgba(255,255,255,0.4)); }

.header-actions { display: flex; align-items: center; gap: 20px; }

/* ==========================================================================
   NAVIGATION LINKS (M3 Pills)
   ========================================================================== */
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a { 
    text-decoration: none; color: var(--md-sys-color-on-surface); 
    font-weight: 500; font-size: 15px; padding: 10px 18px; 
    border-radius: var(--md-sys-shape-corner-full);
    transition: all 0.2s var(--md-sys-motion-easing-emphasized); 
}
.nav-links a:hover { background-color: var(--md-sys-color-surface-container-high); }
.nav-links a.active {
    background-color: var(--md-sys-color-primary); /* Κρατάμε το μπλε φόντο */
    color: #ffffff !important; /* Κάνουμε τα γράμματα ΟΛΟΛΕΥΚΑ για τέλεια αντίθεση */
    font-weight: 600; /* Τα κάνουμε ελαφρώς πιο παχιά για να ξεχωρίζουν */
}

/* Για να παραμένουν λευκά τα γράμματα ακόμα και όταν περνάει το ποντίκι (hover) από πάνω */
.nav-links a.active:hover {
    color: #ffffff !important;
}

.header-controls { display: flex; align-items: center; gap: 12px; }

/* ==========================================================================
   PIXEL QPR3 THEME TOGGLE (Elastic Morph)
   ========================================================================== */
.m3-icon-button {
    width: 44px; height: 44px; border-radius: 50%; border: none;
    background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
    transition: background-color 0.4s var(--md-sys-motion-easing-emphasized);
}

.theme-icon {
    font-size: 24px;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    will-change: transform, opacity;
}

.m3-icon-button:active .theme-icon { transform: scale(0.7); }

.theme-animate-sun { animation: sun-to-moon 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.theme-animate-moon { animation: moon-to-sun 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

@keyframes sun-to-moon {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(90deg) scale(0.5); opacity: 0.5; }
    100% { transform: rotate(360deg) scale(1); opacity: 1; }
}

@keyframes moon-to-sun {
    0% { transform: rotate(360deg) scale(1); }
    50% { transform: rotate(180deg) scale(0.5); opacity: 0.5; }
    100% { transform: rotate(0deg) scale(1); opacity: 1; }
}

.m3-icon-button::after {
    content: ''; position: absolute; width: 100%; height: 100%;
    background-color: currentColor; opacity: 0; transition: opacity 0.2s;
}
.m3-icon-button:hover::after { opacity: 0.08; }

/* ==========================================================================
   M3 LANGUAGE TOGGLE (Bouncy Flags + Globe)
   ========================================================================== */
.m3-lang-toggle {
    display: flex; 
    align-items: center; 
    background-color: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-sys-shape-corner-full);
    padding: 4px 6px 4px 12px; /* Χώρος για την υδρόγειο */
    gap: 6px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.03);
}

.m3-lang-toggle:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Το Εικονίδιο της Υδρογείου που Γυρίζει */
.lang-globe {
    font-size: 20px;
    color: var(--md-sys-color-primary);
    margin-right: 2px;
    opacity: 0.8;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s;
    will-change: transform;
}

.m3-lang-toggle:hover .lang-globe {
    transform: rotate(180deg) scale(1.1);
    opacity: 1;
}

/* Το container της κάθε σημαίας */
.lang-btn {
    display: flex; 
    align-items: center; 
    justify-content: center;
    width: 36px; 
    height: 36px;
    border-radius: 50%;
    text-decoration: none;
    position: relative;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Η ίδια η σημαία */
.lang-flag {
    width: 22px; 
    height: 22px;
    border-radius: 50%; /* Στρογγυλή σημαία */
    object-fit: cover;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: grayscale(80%) opacity(0.6); /* Η ανενεργή σημαία είναι αχνή */
}

/* Hover στην ανενεργή σημαία (Παίρνει χρώμα και πηδάει) */
.lang-btn:hover:not(.active) .lang-flag {
    filter: grayscale(0%) opacity(1);
    transform: translateY(-2px) scale(1.15);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Το Ενεργό (Επιλεγμένο) Κουμπί */
.lang-btn.active {
    pointer-events: none;
}

/* Η ενεργή σημαία έχει κανονικά χρώματα και είναι λίγο μεγαλύτερη */
.lang-btn.active .lang-flag {
    filter: grayscale(0%) opacity(1);
    width: 26px;
    height: 26px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Το Background της Ενεργής Σημαίας (Κάνει Pop και φτιάχνει "δαχτυλίδι") */
.lang-btn.active::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--md-sys-color-primary-container);
    border-radius: 50%;
    z-index: -1;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    animation: lang-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Dark Mode Προσαρμογές */
body.dark-mode .m3-lang-toggle {
    background-color: var(--md-sys-color-surface-container-low);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
body.dark-mode .lang-btn.active::before {
    background-color: rgba(255, 255, 255, 0.1); /* Διακριτικό δαχτυλίδι στο σκοτάδι */
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

/* Το Animation εμφάνισης του δαχτυλιδιού */
@keyframes lang-pop {
    0% { transform: scale(0.4); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   GLOBAL BUTTONS & RIPPLE
   ========================================================================== */
.m3-button-filled, .m3-button-tonal, .m3-button-text {
    border: none; cursor: pointer; font-family: 'Roboto', sans-serif; 
    font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; transition: all 0.3s var(--md-sys-motion-easing-emphasized);
}

.m3-button-filled { background-color: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); padding: 12px 28px; border-radius: var(--md-sys-shape-corner-full); }
.m3-button-tonal { background-color: var(--md-sys-color-secondary); color: var(--md-sys-color-on-secondary); padding: 12px 28px; border-radius: var(--md-sys-shape-corner-full); }
.m3-button-filled:active, .m3-button-tonal:active { transform: scale(0.95); }

.ripple {
    position: absolute; border-radius: 50%; transform: scale(0);
    animation: ripple-animation 600ms cubic-bezier(0.2, 0, 0, 1); pointer-events: none;
    background-color: rgba(255, 255, 255, 0.3);
}
.m3-button-tonal .ripple, .m3-filter-chip .ripple, .m3-card .ripple, .m3-icon-button .ripple { background-color: rgba(0, 0, 0, 0.1); }
body.dark-mode .m3-button-tonal .ripple, body.dark-mode .m3-icon-button .ripple { background-color: rgba(255, 255, 255, 0.1); }

@keyframes ripple-animation {
    to { transform: scale(4); opacity: 0; }
}

/* ==========================================================================
   DECHRO AI LOGO - "GEMINI/ASSISTANT" GLOW
   ========================================================================== */
.dechro-ai-icon {
    width: 75%; height: 75%; object-fit: contain;
    animation: ai-gemini-glow 5s infinite ease-in-out;
    transition: all 0.4s var(--md-sys-motion-easing-emphasized);
    will-change: filter, transform;
}

/* Απαλό, υγρό animation τύπου Google Assistant / Gemini */
@keyframes ai-gemini-glow {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(0, 195, 255, 0.3)); transform: scale(1); }
    33% { filter: drop-shadow(0 0 10px rgba(138, 43, 226, 0.5)) brightness(1.2); transform: scale(1.03); } /* Μωβ τόνος */
    66% { filter: drop-shadow(0 0 12px rgba(0, 255, 255, 0.6)) brightness(1.1); transform: scale(1.02); } /* Γαλάζιος τόνος */
}

.ai-avatar:hover .dechro-ai-icon, .floating-ai-btn:hover .dechro-ai-icon {
    animation-play-state: paused;
    filter: drop-shadow(0 0 16px rgba(0, 195, 255, 0.8)) brightness(1.3); 
    transform: scale(1.06);
}

.floating-ai-btn {
    position: fixed; bottom: 32px; right: 32px;
    background: #0d1218; color: white; width: 68px; height: 68px; border-radius: 22px; 
    display: flex; align-items: center; justify-content: center; text-decoration: none;
    box-shadow: 0 12px 28px rgba(0,0,0,0.25); z-index: 9999;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bounce transition */
}
.floating-ai-btn:hover { transform: translateY(-8px) scale(1.05); box-shadow: 0 16px 32px rgba(0,0,0,0.3); }
.floating-ai-btn:active { transform: translateY(0) scale(0.95); }

/* ==========================================================================
   FOOTER & LEGAL
   ========================================================================== */
.global-footer { background-color: var(--md-sys-color-surface-container-low); padding: 48px 24px 24px; margin-top: 64px; border-top: 1px solid var(--md-sys-color-surface-container-high);}
.footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 32px; }
.footer-section h3 { font-size: 16px; margin-bottom: 16px; color: var(--md-sys-color-primary); }
.footer-section a { color: var(--md-sys-color-on-surface); text-decoration: none; font-size: 14px; margin-bottom: 10px; display: block; opacity: 0.7; transition: opacity 0.2s; }
.footer-section a:hover { opacity: 1; color: var(--md-sys-color-primary); }
.footer-bottom { 
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
    border-top: 1px solid var(--md-sys-color-surface-container-high); padding-top: 24px; margin-top: 48px; font-size: 13px; opacity: 0.6; 
}

/* ==========================================================================
   MOBILE QUERIES & M3 DROPDOWN MENU
   ========================================================================== */
.mobile-menu-btn { display: none; background: transparent; border: none; color: var(--md-sys-color-on-surface); cursor: pointer; padding: 8px; border-radius: 50%; transition: background-color 0.2s; }
.mobile-menu-btn:active { background-color: var(--md-sys-color-surface-container-high); }

@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }
    .brand-name { font-size: 18px; }
    .m3-top-app-bar { padding: 12px 16px; }
    .header-actions { gap: 8px; }
    
    /* M3 Floating Mobile Menu */
    .nav-links {
        position: absolute; top: 100%; left: 16px; right: 16px;
        background-color: var(--md-sys-color-surface-container);
        border: 1px solid var(--md-sys-color-surface-container-high);
        border-radius: 24px;
        flex-direction: column; padding: 0; gap: 4px;
        max-height: 0; overflow: hidden; opacity: 0;
        transition: all 0.4s var(--md-sys-motion-easing-emphasized);
        box-shadow: var(--md-sys-elevation-2);
        transform: translateY(-10px);
        pointer-events: none;
    }
    
    .nav-links.open {
        max-height: 400px; padding: 16px; opacity: 1;
        transform: translateY(12px);
        pointer-events: auto;
    }
    
    .nav-links a { width: 100%; text-align: center; padding: 14px; border-radius: 16px; }
    
    .floating-ai-btn { bottom: 20px; right: 20px; width: 56px; height: 56px; border-radius: 18px; }
    .footer-bottom { flex-direction: column; text-align: center; justify-content: center; }
}

/* Νέο, πανέμορφο ταμπελάκι BETA (AI Gradient) */
.beta-badge {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 10px;
    vertical-align: text-top; /* Το ανεβάζει ελαφρώς πιο ψηλά */
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(236, 72, 153, 0.4);
    display: inline-block;
    line-height: 1;
    border: none;
}