/* =========================================
   1. GLOBAL: VARIABILE, MENIU, FOOTER, DEFAULT
   ========================================= */

:root {
    /* --- CULORI DARK MODE (DEFAULT) --- */
    --bg-color: #010a05; --surface-color: #05140a; 
    --menu-bg: #020d07; --menu-details-bg: rgba(22, 117, 67, 0.08); 
    --text-primary: #f0fdf4; --text-secondary: #88998c; 
    --accent: #167543; --nav-hover: #4ade80; 
    --glass-bg: rgba(22, 117, 67, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --glass-blur: blur(16px);
    --easing: cubic-bezier(0.19, 1, 0.22, 1);
    --font-display: 'Satoshi', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body.light-mode {
    --bg-color: #f2f4f8; --surface-color: #ffffff;
    --menu-bg: #ffffff; --menu-details-bg: rgba(0, 0, 0, 0.03);
    --text-primary: #0a0a0a; --text-secondary: #555555;
    --nav-hover: #15803d; 
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(22, 117, 67, 0.1);
}

/* BASE RESET */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg-color); color: var(--text-primary); font-family: var(--font-body); overflow-x: hidden; transition: 0.5s; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
.mod-custom { display: contents; }
.container { width: 90%; max-width: 1300px; margin: 0 auto; }

/* UTILITARE GLOBALE */
section { padding: 6rem 0; position: relative; z-index: 1; background: var(--bg-color); }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 4rem; padding-bottom: 2rem; border-bottom: 1px solid var(--glass-border); }
.section-label { color: var(--accent); font-size: 0.8rem; letter-spacing: 2px; text-transform: uppercase; display: block; margin-bottom: 1rem;}
.section-title { font-family: var(--font-display); font-size: 2.5rem; color: var(--text-primary); position: relative; display: inline-block; }
.section-title::after { content: ''; position: absolute; bottom: -10px; left: 0; width: 60px; height: 4px; background: var(--accent); box-shadow: 0 0 15px var(--accent); }

/* =========================================
   2. NAVIGARE & LOGO
   ========================================= */
.logo-raw { position: absolute; top: 2rem; left: 2.5rem; z-index: 1001; transition: transform 0.4s; }
.raw-img { height: 85px; width: auto; filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.6)); transition: 0.3s; }
.logo-raw:hover { transform: scale(1.1) translateY(2px); }
.logo-raw:hover .raw-img { filter: drop-shadow(0 0 50px rgba(255, 255, 255, 0.9)); }
body.light-mode .raw-img { filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4)); }
body.light-mode .logo-raw:hover .raw-img { filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.6)); }

.nav-wrapper { position: fixed; top: 2rem; left: 50%; transform: translateX(-50%); z-index: 1000; width: auto; }
.dynamic-island {
    background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    border-radius: 100px; padding: 0.6rem; display: flex; align-items: center; justify-content: center; 
    gap: 2rem; min-width: 320px; transition: all 0.4s var(--easing);
}
.nav-text-label { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--text-primary); letter-spacing: -0.5px; text-transform: uppercase; }
.nav-controls { display: flex; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid transparent; display: flex; align-items: center; justify-content: center; color: var(--text-primary); cursor: pointer; transition: 0.3s; background: rgba(255,255,255,0.05); }
.icon-btn:hover { background: var(--accent); color: white; box-shadow: 0 0 15px var(--accent); }

/* MENIU FULLSCREEN */
.fullscreen-menu { position: fixed; inset: 0; background-color: var(--menu-bg); z-index: 2000; display: flex; opacity: 0; pointer-events: none; transition: 0.4s var(--easing); padding: 0; }
.fullscreen-menu.active { opacity: 1; pointer-events: all; }
.menu-grid { display: grid; grid-template-columns: 200px 1fr 1.5fr; width: 100%; height: 100%; }
.menu-col-label { border-right: 1px solid var(--glass-border); height: 100%; display: flex; flex-direction: column; justify-content: center; padding-left: 4rem; }
.menu-links { display: flex; flex-direction: column; justify-content: center; padding-left: 4rem; padding-right: 4rem; border-right: 1px solid var(--glass-border); gap: 1rem; }

/* -------------------------------------------------------------
   STILURI MENIU UNIFICATE (FIX PENTRU ASPECTUL MIC)
   Aplicăm aceleași reguli pentru .menu-item (link) și .menu-static (părinte)
------------------------------------------------------------- */
.menu-item, 
.menu-static { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    width: 100%; 
    max-width: 450px; 
    font-family: var(--font-display); 
    font-size: clamp(1.8rem, 3vw, 2.5rem); /* Dimensiunea mare */
    color: var(--text-secondary); 
    text-decoration: none; 
    padding: 10px 0; 
    border-bottom: 1px solid transparent; 
    transition: all 0.3s ease; 
}

/* Diferențiere cursor */
.menu-item { cursor: pointer; }
.menu-static { cursor: default; }

/* Săgeata */
.menu-arrow { 
    font-size: 1.2rem; 
    opacity: 0; 
    transform: translateX(-10px); 
    transition: all 0.3s ease; 
    color: var(--nav-hover); 
}

/* Hover & Active comun */
.menu-item:hover, .menu-item.active,
.menu-static:hover, .menu-static.active { 
    color: var(--nav-hover); 
    border-bottom: 1px solid rgba(136, 153, 140, 0.2); 
    padding-left: 10px; 
}

.menu-item:hover .menu-arrow,
.menu-static:hover .menu-arrow { 
    opacity: 1; 
    transform: translateX(0); 
}
/* ------------------------------------------------------------- */

.menu-details { padding: 5rem; display: flex; flex-direction: column; justify-content: center; background: radial-gradient(circle at center, var(--menu-details-bg) 0%, transparent 80%); overflow-y: auto; }
.submenu-container { display: none; animation: fadeInRight 0.4s var(--easing) forwards; }
.submenu-container.active { display: block; }
.submenu-header { font-family: var(--font-display); font-size: 0.9rem; color: var(--accent); margin-bottom: 1.2rem; text-transform: uppercase; letter-spacing: 2px; font-weight: 900; display: flex; align-items: center; gap: 12px; }
.submenu-header::after { content: ''; flex-grow: 1; height: 1px; background: var(--text-secondary); opacity: 0.2; }
.submenu-list { list-style: none; display: grid; grid-template-columns: 1fr; gap: 0.5rem; }
.submenu-link { 
  display: flex;
  align-items: center;
  gap: 15px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-secondary);
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: 0.2s ease; background: transparent; 
}

.submenu-link:hover { background: rgba(255, 255, 255, 0.05); transform: translateX(5px); color: var(--nav-hover); }
body.light-mode .submenu-link:hover { background: rgba(0,0,0,0.05); }
.submenu-link i { color: var(--text-secondary); font-size: 1rem; width: 24px; text-align: center; transition: 0.3s; }
.submenu-link:hover i { color: var(--nav-hover); }

/* BUTONUL X */
.close-menu { position: absolute; top: 2rem; right: 2rem; background: none; border: none; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; z-index: 2005; width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--glass-border); transition: 0.3s; }
.close-menu:hover { background: var(--accent); border-color: var(--accent); color: white; transform: rotate(90deg); }
body.light-mode .close-menu { color: #000 !important; border-color: rgba(0,0,0,0.2) !important; background: rgba(0,0,0,0.05); }
body.light-mode .close-menu:hover { background: var(--accent); color: #fff !important; border-color: var(--accent) !important; }

/* FOOTER */
footer { padding: 5rem 0; border-top: 1px solid var(--glass-border); background: var(--bg-color); }
.footer-cta { font-family: var(--font-display); font-size: 3vw; line-height: 1.2; margin-bottom: 4rem; color: var(--text-primary); }
.footer-cta span { color: var(--accent); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 3rem; margin-bottom: 3rem; }
.footer-col h4 { font-family: var(--font-display); margin-bottom: 1.5rem; font-size: 1.2rem; }
.footer-col li { margin-bottom: 0.8rem; }
.footer-col a { color: var(--text-secondary); transition: 0.3s; }
.footer-col a:hover { color: var(--accent); }
.footer-col p { color: var(--text-secondary); margin-bottom: 0.8rem; display: flex; align-items: center; gap: 10px; }

/* PAGINI INTERNE & DEFAULT */
.page-internal .internal-page-wrapper, .com-content-category-blog, .com-content-article { padding-top: 160px; padding-bottom: 5rem; width: 90%; max-width: 1300px; margin: 0 auto; min-height: 80vh; }
.internal-header h1, .page-header h1 { font-family: var(--font-display); font-size: 3rem; color: var(--accent); margin-bottom: 3rem; border-bottom: 1px solid var(--glass-border); padding-bottom: 1rem; }
.blog-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 2rem; }
.blog-item, .items-leading .item, .items-row .item { background: var(--surface-color); border: 1px solid var(--glass-border); border-radius: 20px; padding: 2.5rem; display: flex; flex-direction: column; transition: all 0.3s ease; position: relative; overflow: hidden; }
.blog-item:hover, .items-leading .item:hover, .items-row .item:hover { transform: translateY(-7px); border-color: var(--accent); box-shadow: 0 10px 30px rgba(22, 117, 67, 0.15); }
.item-title { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 1rem; line-height: 1.2; }
.item-title a { color: var(--text-primary); text-decoration: none; transition: 0.2s; }
.item-title a:hover { color: var(--accent); }
.item-image img { width: 100%; height: 220px; object-fit: cover; border-radius: 12px; margin-bottom: 1.5rem; border: 1px solid var(--glass-border); }
.item-content, .item-intro { color: var(--text-secondary); font-size: 1rem; line-height: 1.6; margin-bottom: 1.5rem; flex-grow: 1; }
.readmore a { display: inline-block; padding: 0.8rem 2rem; border: 1px solid var(--glass-border); border-radius: 50px; color: var(--text-primary); font-size: 0.9rem; font-weight: 600; text-decoration: none; background: rgba(255,255,255,0.03); transition: 0.3s; }
.readmore a:hover { background: var(--accent); border-color: var(--accent); color: white; }
.article-info { font-size: 0.8rem; color: var(--text-secondary); opacity: 0.6; margin-bottom: 1rem; display: flex; gap: 10px; text-transform: uppercase; letter-spacing: 1px; }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* RESPONSIVE GLOBAL */
@media (max-width: 900px) {
    .menu-grid { display: flex; flex-direction: column; padding: 4rem 2rem; overflow-y: auto; }
    .menu-col-label, .menu-details { display: none !important; }
    .menu-links { padding: 0; border: none; align-items: center; text-align: center; width: 100%; }
    
    /* MODIFICARE PENTRU MOBIL: Ambele clase trebuie să fie mari */
    .menu-item, 
    .menu-static { 
        justify-content: center; 
        font-size: 2rem; 
        margin-bottom: 1rem; 
    }
    
    .menu-arrow { display: none; }
    .mobile-submenu-wrapper { width: 100%; background: rgba(255, 255, 255, 0.05); border-radius: 12px; margin-bottom: 1rem; overflow: hidden; display: none; animation: slideDown 0.3s ease forwards; border: 1px solid var(--glass-border); }
    .mobile-submenu-wrapper.open { display: block; }
    .mobile-submenu-wrapper .submenu-link { padding: 15px 20px; font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--text-secondary); justify-content: flex-start; }
    .mobile-submenu-wrapper .submenu-link:last-child { border-bottom: none; }
    .mobile-submenu-wrapper .submenu-link i { margin-right: 15px; color: var(--accent); }
    .menu-item.has-children::after { content: '\f107'; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 1rem; margin-left: 10px; transition: 0.3s; }
    .menu-item.has-children.open::after { transform: rotate(180deg); color: var(--accent); }
}
@media (max-width: 768px) {
    .nav-wrapper { position: fixed; top: 15px; left: 0; width: 100%; height: auto; display: flex; justify-content: center; z-index: 1000; pointer-events: none; transform: none !important; }
    .dynamic-island { pointer-events: auto; width: 90%; max-width: 380px; min-width: auto; padding: 0.5rem 1rem; gap: 1rem; display: flex; justify-content: space-between; align-items: center; background: rgba(15, 15, 15, 0.9); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.15); border-radius: 50px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
    body.light-mode .dynamic-island { background: rgba(255, 255, 255, 0.95); border: 1px solid rgba(0,0,0,0.1); box-shadow: 0 5px 20px rgba(0,0,0,0.1); }
    .nav-text-label { display: none; }
    .logo-raw { display: none !important; }
    .nav-brand-group::before { content: ''; display: block; width: 36px; height: 36px; background-image: url('/images/Stiinte.png'); background-size: contain; background-repeat: no-repeat; background-position: center; filter: drop-shadow(0 0 5px rgba(255,255,255,0.3)); }
    body.light-mode .nav-brand-group::before { filter: drop-shadow(0 0 2px rgba(0,0,0,0.2)); }
    .nav-controls { display: flex; gap: 10px; }
    .icon-btn { width: 40px; height: 40px; background: rgba(255,255,255,0.1); }
    body.light-mode .icon-btn { background: rgba(0,0,0,0.05); color: #000; }
    .close-menu { display: block !important; top: 15px; right: 15px; background: rgba(0,0,0,0.5); border-color: rgba(255,255,255,0.2); }
    .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 2rem; }
    .footer-col p, .footer-col div[style*="display: flex"] { justify-content: center; }
}
@media (max-width: 400px) {
    .dynamic-island { padding: 0.5rem; width: 95%; }
}