/* === Scrollbar - Dark Mode === */
html.dark ::-webkit-scrollbar { width: 8px; }
html.dark ::-webkit-scrollbar-track { background: #000; }
html.dark ::-webkit-scrollbar-thumb { background: #F9D312; }

/* === Scrollbar - Light Mode === */
html:not(.dark) ::-webkit-scrollbar { width: 8px; }
html:not(.dark) ::-webkit-scrollbar-track { background: #f3f4f6; }
html:not(.dark) ::-webkit-scrollbar-thumb { background: #F9D312; }

/* === Smooth Scroll === */
html { scroll-behavior: smooth; }

/* === Focus Visible — Keyboard Accessibility === */
:focus-visible {
    outline: 2px solid #F9D312;
    outline-offset: 2px;
}
:focus:not(:focus-visible) {
    outline: none;
}

/* === Active Nav Link Underline === */
nav a[aria-current="page"] {
    position: relative;
}
nav a[aria-current="page"]::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #F9D312;
}

/* === Architectural Grid Pattern === */
.arch-grid {
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, rgba(249, 211, 18, 0.15) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(249, 211, 18, 0.15) 1px, transparent 1px);
}
.dark .arch-grid {
    background-image:
        linear-gradient(to right, rgba(249, 211, 18, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(249, 211, 18, 0.08) 1px, transparent 1px);
}

/* === WhatsApp Button — Entrance + Pulse === */
.whatsapp-float {
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.whatsapp-float.visible {
    opacity: 1;
    transform: scale(1);
}
.whatsapp-pulse { animation: pulse-green 2s infinite; }
@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    50% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
}

/* === Form Focus Styles === */
.form-input:focus {
    outline: none;
    border-color: #F9D312;
    box-shadow: 0 0 0 2px rgba(249, 211, 18, 0.2);
}

/* === Page Transition — Sliding Curtain + Accent Sweep === */

/* Overlay curtain: covers page on load, slides away to reveal */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: #0a0a0a;
    pointer-events: none;
}

/* Reveal: curtain slides upward off-screen */
body.page-ready::before {
    animation: curtain-reveal 580ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

/* Leave: curtain slides up from below to cover */
body.page-leaving::before {
    animation: curtain-cover 460ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
    pointer-events: all;
}

@keyframes curtain-reveal {
    from { transform: translateY(0); }
    to   { transform: translateY(-100%); }
}
@keyframes curtain-cover {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* Accent line: horizontal branded sweep across viewport center */
.transition-line {
    position: fixed;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 9999;
    pointer-events: none;
    background: #F9D312;
    box-shadow:
        0 0 12px rgba(249, 211, 18, 0.7),
        0 0 36px rgba(249, 211, 18, 0.18);
    transform: scaleX(0);
    transform-origin: left center;
    opacity: 0;
}
.transition-line.sweep-enter {
    animation: accent-sweep 780ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.transition-line.sweep-leave {
    animation: accent-sweep 620ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes accent-sweep {
    0%   { opacity: 1; transform: scaleX(0); }
    55%  { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(1); }
}

/* Accessibility: instant transition for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    body::before {
        animation: none !important;
        transition: opacity 0.01s;
    }
    body.page-ready::before  { opacity: 0; }
    body.page-leaving::before { opacity: 1; }
    .transition-line { display: none; }
}

/* === FAQ Accordion === */
.faq-item summary { list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { display: none; }
.faq-item .faq-icon { transition: transform 0.3s ease; }
.faq-item[open] .faq-icon { transform: rotate(45deg); }

/* === Scroll-to-Top Button === */
.scroll-top-btn {
    position: fixed;
    bottom: 104px;
    right: 24px;
    z-index: 50;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F9D312;
    color: #000;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.2s;
}
.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-top-btn:hover {
    background: #000;
    color: #fff;
}
.dark .scroll-top-btn:hover {
    background: #fff;
    color: #000;
}

/* === Carousel === */
.carousel-dots { display: flex; justify-content: center; align-items: center; gap: 6px; }
.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    padding: 0;
    cursor: pointer;
    background: #d4d4d4;
    transition: background 0.3s, transform 0.3s, width 0.3s, opacity 0.3s;
}
.dark .carousel-dot {
    background: #525252;
}
.carousel-dot:hover { background: #a3a3a3; }
.carousel-dot.active {
    background: #F9D312;
    width: 24px;
    border-radius: 4px;
}
/* Hide overflow dots when there are too many (>9) */
.carousel-dots.truncated .carousel-dot {
    display: none;
}
.carousel-dots.truncated .carousel-dot.dot-visible {
    display: block;
}
.carousel-counter {
    font-family: 'Space Grotesk', monospace;
    font-size: 12px;
    letter-spacing: 0.15em;
    color: #737373;
    user-select: none;
}
.carousel-counter .current { color: #F9D312; font-weight: 500; }

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #F9D312;
    color: #F9D312;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
    opacity: 0;
}
.carousel-container:hover .carousel-nav-btn,
.carousel-nav-btn:focus-visible { opacity: 1; }
@media (hover: none) { .carousel-nav-btn { opacity: 1; } }
.carousel-nav-btn:hover { background: #F9D312; color: #000; }
.carousel-nav-btn.prev { left: 4px; }
.carousel-nav-btn.next { right: 4px; }

html.dark .carousel-nav-btn { background: rgba(0,0,0,0.8); }
html:not(.dark) .carousel-nav-btn { background: rgba(255,255,255,0.8); }
html.dark .carousel-nav-btn:hover,
html:not(.dark) .carousel-nav-btn:hover { background: #F9D312; color: #000; }

/* Progress bar under carousel */
.carousel-progress {
    height: 2px;
    background: #e5e5e5;
    margin-top: 16px;
    overflow: hidden;
}
.dark .carousel-progress {
    background: #262626;
}
.carousel-progress-bar {
    height: 100%;
    background: #F9D312;
    transition: width 0.3s ease;
}

/* === Service Card Hover Lift === */
.carousel-slide article {
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.2s;
}
.carousel-slide article:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(249, 211, 18, 0.08);
}

/* === Lucrari Card Background Image === */
.card-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 280px;
}

/* === Portfolio Filter Buttons === */
.filter-btn.active {
    border-color: #b45309;
    color: #b45309;
}
.dark .filter-btn.active {
    border-color: #F9D312;
    color: #F9D312;
}
.portfolio-card {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* === Lightbox === */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.open {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.lightbox-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-color: #F9D312;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-nav:hover {
    color: #000;
    background: #F9D312;
    border-color: #F9D312;
}

.lightbox-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 60px 80px;
    cursor: default;
}
.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.15s ease, transform 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Space Grotesk', monospace;
    font-size: 13px;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.5);
    user-select: none;
}

/* Photo count badge on cards */
.photo-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    font-family: 'Space Grotesk', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Portfolio card image hover */
.portfolio-card-img {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.portfolio-card-img img {
    transition: transform 0.4s ease;
}
.portfolio-card-img:hover img {
    transform: scale(1.03);
}
.portfolio-card-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.08) 0%, transparent 40%);
    pointer-events: none;
    transition: opacity 0.3s;
}
.portfolio-card-img:hover::after {
    opacity: 0.6;
}

/* Lightbox mobile adjustments */
@media (max-width: 768px) {
    .lightbox-img-wrap {
        padding: 50px 12px;
    }
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
}

/* === Scroll Reveal Animation === */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}
/* Stagger children */
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 0.24s; }

/* === Mobile Menu Animation === */
.mobile-menu-animated {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu-animated.menu-open {
    max-height: 400px;
}

/* === Hamburger → X Animation === */
.hamburger-icon {
    width: 24px;
    height: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.hamburger-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
    transition: transform 0.3s ease, opacity 0.2s ease;
    transform-origin: center;
}
.hamburger-icon.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger-icon.open span:nth-child(2) {
    opacity: 0;
}
.hamburger-icon.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .lightbox { transition: none; }
    .lightbox-img { transition: none; }
    .portfolio-card-img img { transition: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .mobile-menu-animated { transition: none; }
}
