/*
Theme Name: AGECS
Theme URI:
Author: AGECS Development Team
Author URI:
Description: WordPress theme for AGECS
Version: 1.0.0
Requires at least: 5.9
Tested up to: 6.5
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: agecs
/* =================================================================
   BASE RESET
   ================================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    color: #444;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

ul {
    list-style: none;
}

/* ---- Page Wrapper ---- */
#tm-page {
    position: relative;
    width: 100%;
    overflow-x: hidden;
}

/* =================================================================
   CONTAINER
   ================================================================= */

.tm-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
}

/* =================================================================
   SECTION TITLES (globale — folosite pe toate paginile)
   ================================================================= */

.tm-section-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.tm-section-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(1.6rem, 2.8vw, 2.6rem);
    color: #2c3e50;
    margin: 0 0 14px;
}

.tm-section-title-accent {
    display: inline-block;
    position: relative;
}

.tm-section-title-accent::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #2193b0, #6dd5ed);
    border-radius: 2px;
}

.tm-section-subtitle {
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    color: #5a6a7a;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* =================================================================
   WAVE SEPARATORS
   ================================================================= */

.tm-wave {
    display: block;
    line-height: 0;
    margin-bottom: -2px;
}

.tm-wave svg {
    display: block;
    width: 100%;
    height: 80px;
}

.tm-wave-hero-to-video {
    margin-top: -80px;
    position: relative;
    z-index: 5;
    background: transparent;
}

.tm-wave-light-to-white {
    background: #f0fafd;
}

.tm-wave-white-to-light {
    background: #ffffff;
}

/* =================================================================
   FADE-IN LA SCROLL (IntersectionObserver)
   ================================================================= */

.tm-reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.tm-reveal.tm-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .tm-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* =================================================================
   HEADER
   ================================================================= */

#tm-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    overflow: visible;
    transition: background 0.35s ease, box-shadow 0.35s ease;
}

.tm-header-inner {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    overflow: visible;
}

#tm-site-logo {
    display: flex;
    align-items: center;
    padding: 0 0 0 clamp(20px, 6.5vw, 110px);
    text-decoration: none;
    white-space: nowrap;
}

/* Logo imagine */
.tm-site-logo-img {
    height: 80px;
    width: auto;
    display: block;
    transition: height 0.35s ease;
}

.tm-site-logo-img--drawer {
    height: 48px;
}

.tm-site-logo-img--footer {
    height: 44px;
}

#tm-header.scrolled .tm-site-logo-img {
    height: 36px;
}

.gear-icon {
    position: absolute;
    top: 18px;
    right: 12px;
    width: 20px;
    height: 20px;
    fill: rgba(33, 147, 176, 0.5);
}

.ui-frame-borderless {
    border: none;
    border-radius: 0;
    padding: 25px 35px;
    position: relative;
    background: transparent;
    transition: padding 0.35s ease;
}

.is-eco-page #tm-site-logo .ui-frame-borderless::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 420px;
    height: 260px;
    transform: translate(-50%, -50%) rotate(10deg);
    background: rgba(255, 255, 255, 0.18);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    z-index: 0;
    pointer-events: none;
}

.ui-frame-borderless > * {
    position: relative;
    z-index: 1;
}

.ui-frame-borderless .gear-icon {
    position: absolute;
    z-index: 1;
}

.logo-with-frame-tight {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-in-frame {
    display: flex;
    align-items: center;
    gap: 2px;
}

.logo-in-frame-text {
    font-size: 3rem;
    font-weight: 800;
    font-family: "Arial", sans-serif;
    line-height: 1;
    transition: font-size 0.35s ease;
}

.logo-montserrat {
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
}

.bulb-in-frame {
    position: relative;
    width: 50px;
    height: 50px;
    margin: 0 3px;
    transition: width 0.35s ease, height 0.35s ease;
}

.bulb-in-frame .bulb-center {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.4);
}

.compact-bulb-icon {
    width: 22px;
    height: 22px;
}

#tm-nav {
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 clamp(16px, 3.5vw, 52px) 0 clamp(36px, 6vw, 100px);
    min-height: 96px;
    overflow: visible;
    transition: min-height 0.35s ease, padding 0.35s ease;
}

#tm-nav::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: #1e2b38;
    clip-path: polygon(52px 0%, 100% 0%, 100% 100%, 0% 100%);
    z-index: 0;
    pointer-events: none;
}

#tm-nav > * {
    position: relative;
    z-index: 1;
}

#primary-menu {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2.5vw, 46px);
    margin: 0;
    padding: 0;
}

#primary-menu li a {
    color: #ffffff;
    font-size: clamp(11px, 0.9vw, 13px);
    font-weight: 600;
    letter-spacing: clamp(1px, 0.15vw, 2px);
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

#primary-menu li a:hover,
#primary-menu li.current-menu-item > a {
    color: #4dc8c8;
}

#primary-menu li {
    position: relative;
}

#primary-menu li .sub-menu {
    display: block;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 200px;
    background: #1a2e3b;
    border-top: 3px solid #2193b0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
    padding: 8px 0;
    margin: 0;
    list-style: none;
    z-index: 9999;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

#primary-menu li:has(> .sub-menu)::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 100%;
    height: 12px;
    background: transparent;
}

#primary-menu li:hover > .sub-menu,
#primary-menu li:focus-within > .sub-menu {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s;
}

#primary-menu li .sub-menu li {
    width: 100%;
}

#primary-menu li .sub-menu li a {
    display: block;
    padding: 10px 20px;
    font-size: 12px;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.85);
    text-transform: uppercase;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

#primary-menu li .sub-menu li a:hover {
    color: #4dc8c8;
    background: rgba(33,147,176,0.15);
    padding-left: 28px;
}

#primary-menu li:has(> .sub-menu) > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    margin-left: 6px;
    vertical-align: middle;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

#primary-menu li:has(> .sub-menu):hover > a::after {
    transform: rotate(180deg);
}

/* =================================================================
   HEADER STICKY / SCROLLED STATE
   ================================================================= */

#tm-header.scrolled {
    background: rgba(18, 28, 38, 0.97);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}

#tm-header.scrolled #tm-site-logo .ui-frame-borderless {
    padding: 10px 20px;
}

#tm-header.scrolled .logo-in-frame-text {
    font-size: 2rem;
}

#tm-header.scrolled .bulb-in-frame,
#tm-header.scrolled .bulb-in-frame .bulb-center {
    width: 32px;
    height: 32px;
}

#tm-header.scrolled .compact-bulb-icon {
    width: 15px;
    height: 15px;
    transition: width 0.35s ease, height 0.35s ease;
}

#tm-header.scrolled .gear-icon {
    width: 14px;
    height: 14px;
    top: 8px;
    right: 6px;
    transition: width 0.35s ease, height 0.35s ease, top 0.35s ease, right 0.35s ease;
}

#tm-header.scrolled #tm-nav {
    min-height: 58px;
    padding-top: 0;
    padding-bottom: 0;
}

@media (max-width: 768px) {
    #tm-header.scrolled .tm-header-inner {
        position: relative;
        justify-content: center;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    #tm-header.scrolled #tm-site-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        padding: 0;
        pointer-events: auto;
    }

    #tm-header.scrolled .tm-site-logo-img {
        height: 32px;
    }

    #tm-header.scrolled #tm-hamburger {
        margin-left: auto;
        margin-right: 16px;
    }
}

/* ascunde decoratia diamant pe ecran mic/scroll */
#tm-header.scrolled .is-eco-page .ui-frame-borderless::before,
.scrolled #tm-site-logo .ui-frame-borderless::before {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* =================================================================
   HAMBURGER + MOBILE DRAWER NAV
   ================================================================= */

#tm-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 20px;
    z-index: 1100;
    position: relative;
}

#tm-hamburger span {
    display: block;
    width: 30px;
    height: 3px;
    background: #2c3e50;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease, background 0.35s ease;
    transform-origin: center;
}

#tm-header.scrolled #tm-hamburger span {
    background: rgba(255, 255, 255, 0.6);
}

#tm-hamburger.tm-nav-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
#tm-hamburger.tm-nav-open span:nth-child(2) {
    opacity: 0;
    width: 0;
}
#tm-hamburger.tm-nav-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.tm-nav-drawer-head {
    display: none;
}

#tm-nav-close {
    display: none;
}

#tm-nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#tm-nav-backdrop.tm-nav-open {
    opacity: 1;
}

@media (max-width: 1024px) {
    #primary-menu li .sub-menu {
        left: 0;
        transform: translateX(0) translateY(-6px);
    }
    #primary-menu li:hover > .sub-menu,
    #primary-menu li:focus-within > .sub-menu {
        transform: translateX(0) translateY(0);
    }
}

@media (max-width: 768px) {
    #tm-hamburger {
        display: flex;
        margin-left: auto;
        margin-right: 16px;
        align-self: center;
    }

    #tm-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 80vw;
        max-width: 320px;
        height: 100dvh;
        background: #1e2b38;
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        z-index: 1100;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #tm-nav::before {
        display: none;
    }

    #tm-nav.tm-nav-open {
        transform: translateX(0);
    }

    #tm-nav-backdrop {
        display: block;
        pointer-events: none;
    }

    #tm-nav-backdrop.tm-nav-open {
        pointer-events: auto;
    }

    .tm-nav-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px 0 0;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        width: 100%;
        flex-shrink: 0;
    }

    #tm-site-logo {
        padding: 0 0 0 16px;
    }

    .tm-site-logo-img {
        height: 40px;
    }

    /* drawer logo */
    .tm-nav-drawer-logo {
        text-decoration: none;
        display: flex;
        align-items: center;
        padding: 12px 16px;
    }

    .tm-nav-drawer-logo .tm-site-logo-img--drawer {
        height: 40px;
    }

    .tm-drawer-soft {
        color: #fff !important;
    }

    #tm-nav-close {
        display: flex;
        align-self: center;
        background: none;
        border: none;
        color: rgba(255,255,255,0.6);
        font-size: 1.8rem;
        line-height: 1;
        padding: 10px 12px;
        cursor: pointer;
        transition: color 0.2s;
        flex-shrink: 0;
    }

    #tm-nav-close:hover {
        color: #fff;
    }

    #primary-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        width: 100%;
        padding: 0 0 40px;
    }

    #primary-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }

    #primary-menu li a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 24px;
        font-size: 13px;
        letter-spacing: 1.5px;
    }

    #primary-menu li:has(> .sub-menu) > a::after {
        content: '▾';
        font-size: 0.9rem;
        border: none;
        width: auto;
        height: auto;
        margin-left: 8px;
        opacity: 0.7;
        transition: transform 0.25s ease;
    }

    #primary-menu li:has(> .sub-menu).tm-sub-open > a::after {
        transform: rotate(180deg);
        opacity: 1;
    }

    #primary-menu li .sub-menu {
        position: static;
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transform: none;
        border-top: none;
        border-radius: 0;
        box-shadow: none;
        background: rgba(255,255,255,0.04);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
    }

    #primary-menu li.tm-sub-open > .sub-menu {
        max-height: 600px;
    }

    #primary-menu li:hover > .sub-menu,
    #primary-menu li:focus-within > .sub-menu {
        visibility: visible;
        opacity: 1;
        transform: none;
    }

    #primary-menu li .sub-menu li a {
        padding: 12px 24px 12px 36px;
        font-size: 11px;
        letter-spacing: 1px;
    }

    #primary-menu li .sub-menu li a:hover {
        padding-left: 44px;
    }
}

/* =================================================================
   SCROLL PROGRESS BAR
   ================================================================= */

#tm-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #2193b0, #6dd5ed);
    z-index: 9999;
    transition: width 0.08s linear;
    pointer-events: none;
}

/* =================================================================
   SCROLL TO TOP BUTTON
   ================================================================= */

#tm-scroll-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #2193b0, #6dd5ed);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 20px rgba(33,147,176,0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
    z-index: 9998;
}

#tm-scroll-top.tm-stt-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#tm-scroll-top:hover {
    box-shadow: 0 8px 28px rgba(33,147,176,0.6);
    transform: translateY(-3px);
}

#tm-scroll-top:focus {
    outline: 2px solid #2193b0;
    outline-offset: 3px;
}

/* =================================================================
   FOOTER
   ================================================================= */

#tm-footer {
    background: #1e2b38;
    color: #ffffff;
    padding: 10px 32px;
}

#tm-footer .tm-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

a.tm-footer-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex: 1;
    justify-content: flex-start;
}

a.tm-footer-logo .ui-frame-borderless {
    padding: 16px 20px;
}

a.tm-footer-logo .logo-in-frame-text {
    font-size: 2rem;
}

a.tm-footer-logo .bulb-in-frame,
a.tm-footer-logo .bulb-in-frame .bulb-center {
    width: 34px;
    height: 34px;
}

a.tm-footer-logo .compact-bulb-icon {
    width: 16px;
    height: 16px;
}

a.tm-footer-logo .gear-icon {
    top: 12px;
    right: 8px;
    width: 14px;
    height: 14px;
}

.tm-footer-copy {
    font-size: 13px;
    margin: 0;
    color: #a0b4c2;
    text-align: center;
    flex: 1;
}

a.tm-footer-facebook {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #a0b4c2;
    text-decoration: none;
    font-size: 13px;
    flex: 1;
    justify-content: flex-end;
    transition: color 0.2s;
}

a.tm-footer-facebook svg {
    width: 18px;
    height: 18px;
}

a.tm-footer-facebook:hover {
    color: #6dd5ed;
}

@media (max-width: 600px) {
    #tm-footer .tm-footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    a.tm-footer-logo .ui-frame-borderless {
        padding: 12px 16px;
    }
    a.tm-footer-logo .gear-icon {
        top: 8px;
        right: 5px;
    }
}

/* =================================================================
   CTA BUTTON (global — used on multiple pages)
   ================================================================= */
.tm-hpcta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    color: #1a7a96;
    background: #fff;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    white-space: nowrap;
}

.tm-hpcta-btn:hover {
    background: #f0fafd;
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(0,0,0,0.2);
}

/* =================================================================
   LIGHTBOX — global, used on homepage (portofoliu) and app pages
   ================================================================= */

#tm-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 16, 26, 0);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

#tm-lightbox.lb-open {
    display: flex;
    background: rgba(8, 16, 26, 0.94);
    animation: lb-bg-in 0.3s ease forwards;
}

@keyframes lb-bg-in {
    from { background: rgba(8,16,26,0); }
    to   { background: rgba(8,16,26,0.94); }
}

#tm-lb-inner {
    max-width: 88vw;
    max-height: 88vh;
    text-align: center;
    position: relative;
    animation: lb-scale-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes lb-scale-in {
    from { opacity: 0; transform: scale(0.88); }
    to   { opacity: 1; transform: scale(1); }
}

#tm-lb-img {
    max-width: 85vw;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 32px 100px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.07);
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

#tm-lb-caption {
    margin: 16px 0 0;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.5px;
}

#tm-lb-close {
    position: fixed;
    top: 18px;
    right: 22px;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 100000;
    backdrop-filter: blur(4px);
}

#tm-lb-close:hover {
    background: rgba(255,255,255,0.18);
    transform: rotate(90deg);
}

#tm-lb-prev,
#tm-lb-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.13);
    color: #fff;
    font-size: 1rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 100000;
    backdrop-filter: blur(4px);
}

#tm-lb-prev { left: 18px; }
#tm-lb-next { right: 18px; }

#tm-lb-prev:hover {
    background: rgba(33,147,176,0.45);
    transform: translateY(-50%) scale(1.08);
}

#tm-lb-next:hover {
    background: rgba(33,147,176,0.45);
    transform: translateY(-50%) scale(1.08);
}