/* css/style.css */

/* Global Variables */
:root {
    --bg-light: #F4F4F9;
    --charcoal: #333333;
    --fencing-red: #D72638;
    --fencing-green: #2E7D32;
    --pure-white: #FFFFFF;
}

html {
    scroll-behavior: smooth;
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden;
    /* Αποτρέπει το οριζόντιο scroll στο κινητό */
}

body {
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

#map {
    height: 100vh;
    width: 100%;
    z-index: 10;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #F4F4F9;
}

::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #D72638;
}

/* Improved Sweep Animation for Buttons */
.btn-sweep {
    position: relative;
    z-index: 10;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.btn-sweep::before {
    content: "";
    position: absolute;
    top: 0;
    left: -10%;
    width: 0%;
    height: 100%;
    background: #D72638;
    /* fencingRed */
    transform: skewX(-15deg);
    transition: width 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: -1;
}

.btn-sweep:hover::before {
    width: 130%;
}

/* Variant for outlined buttons */
.btn-sweep-outline {
    border: 2px solid #D72638;
    color: #D72638;
    background: transparent;
}

.btn-sweep-outline:hover {
    color: white;
}

/* -------------------------------------
   Scroll Reveal Animations
   ------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Καθυστέρηση για στοιχεία που εμφανίζονται μαζί (π.χ. κάρτες σε grid) */
.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

/* Grain/Noise Overlay */
.grain-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-image: url("https://grainy-gradients.vercel.app/noise.svg");
    opacity: 0.05;
    pointer-events: none;
    z-index: 50;
}

/* Text Stroke Effect - Fixed for variable font path overlaps */
.text-outline {
    color: #F4F4F9; /* Solid color matching background hides inner letter overlaps */
    text-shadow: 
        -1.5px -1.5px 0 #333333,
         1.5px -1.5px 0 #333333,
        -1.5px  1.5px 0 #333333,
         1.5px  1.5px 0 #333333,
        -1.5px  0     0 #333333,
         1.5px  0     0 #333333,
         0     -1.5px 0 #333333,
         0      1.5px 0 #333333;
}

/* Sophisticated Reveal */
.reveal-up {
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-size: 100% 200%;
    mask-position: 0 100%;
    transition: mask-position 1s cubic-bezier(0.19, 1, 0.22, 1), transform 1s cubic-bezier(0.19, 1, 0.22, 1), opacity 1s;
    transform: translateY(30px);
    opacity: 0;
}

.reveal-up.active {
    mask-position: 0 0;
    transform: translateY(0);
    opacity: 1;
}

#modal-bg-pattern {
    background-image: radial-gradient(#D72638 0.5px, transparent 0.5px);
    background-size: 10px 10px;
}

/* Image mask effect instead of clip-path */
.cadx-frame {
    position: relative;
    overflow: hidden;
    background: #333;
}

/* Clip Slash Utilities (moved from HTML) */
.clip-slash {
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0% 100%);
}

@media (min-width: 1024px) {
    .clip-slash {
        clip-path: polygon(0 0, 100% 0, 100% 88%, 0% 100%);
    }
}

/* -------------------------------------
   Interview Media Player Styles
   ------------------------------------- */
.player-container {
    background: #1a1a1a;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.custom-controls {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    border-radius: 3px;
}

.progress-fill {
    height: 100%;
    background: #D72638;
    width: 0%;
    border-radius: 3px;
    transition: width 0.1s linear;
}

.control-btn {
    color: white;
    transition: all 0.3s ease;
}

.control-btn:hover {
    color: #D72638;
    transform: scale(1.1);
}

/* -------------------------------------
   Footer & Legal Specific Styles
   ------------------------------------- */

footer a {
    position: relative;
    display: inline-block;
}

footer .grid a:not(.text-3xl)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: #D72638;
    transition: width 0.3s ease;
}

footer .grid a:hover::after {
    width: 100%;
}

.legal-content {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo Hover Effect for Sponsor/Dev */
footer img {
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

footer .group:hover img {
    transform: translateY(-2px);
    filter: grayscale(0) invert(0) brightness(1) !important;
}

/* -------------------------------------
   Mobile / Tablet Responsive Overrides
   ------------------------------------- */

/* Hide scrollbar on horizontal-scroll containers */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* On touch devices, always show player controls (no hover) */
@media (max-width: 768px) {
    .custom-controls {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }

    /* Ensure tap targets are at least 44px */
    .control-btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Better touch for progress bar */
    .progress-bar {
        height: 10px;
    }
}


/* =============================================
   DARK MODE THEME
   ============================================= */
[data-theme="dark"] body,
[data-theme="dark"] {
    background-color: #1A1A1A;
    color: #E8E8E8;
}

/* Dark mode navbar */
[data-theme="dark"] #main-nav {
    background: rgba(26, 26, 26, 0.85) !important;
    border-color: rgba(215, 38, 56, 0.2) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] #main-nav a {
    color: #E8E8E8;
}

[data-theme="dark"] #main-nav a:hover {
    color: #D72638 !important;
}

/* Dark mode mobile menu */
[data-theme="dark"] #mobile-menu {
    background: rgba(26, 26, 26, 0.97) !important;
}

[data-theme="dark"] #mobile-menu a {
    color: #E8E8E8 !important;
}

[data-theme="dark"] #mobile-menu a:hover {
    color: #D72638 !important;
}

/* Dark mode sections */
[data-theme="dark"] section {
    background-color: #1A1A1A;
}

/* Dark mode hero text */
[data-theme="dark"] .text-outline {
    color: #1A1A1A;
    text-shadow:
        -1.5px -1.5px 0 #E8E8E8,
         1.5px -1.5px 0 #E8E8E8,
        -1.5px  1.5px 0 #E8E8E8,
         1.5px  1.5px 0 #E8E8E8,
        -1.5px  0     0 #E8E8E8,
         1.5px  0     0 #E8E8E8,
         0     -1.5px 0 #E8E8E8,
         0      1.5px 0 #E8E8E8;
}

/* Dark mode cards */
[data-theme="dark"] .card-dark-aware {
    background-color: #242424 !important;
    border-color: #3A3A3A !important;
}

[data-theme="dark"] .card-dark-aware h3 {
    color: #E8E8E8;
}

[data-theme="dark"] .card-dark-aware:hover h3 {
    color: #D72638;
}

/* Dark mode filter bar */
[data-theme="dark"] .filter-bar {
    background-color: #242424 !important;
    border-color: #3A3A3A !important;
}

[data-theme="dark"] .filter-bar input {
    background-color: #1A1A1A !important;
    color: #E8E8E8 !important;
}

[data-theme="dark"] .filter-btn {
    background-color: #1A1A1A !important;
    color: #E8E8E8 !important;
}

[data-theme="dark"] .filter-btn.active {
    background-color: #D72638 !important;
    color: #FFFFFF !important;
}

[data-theme="dark"] .filter-btn:hover:not(.active) {
    background-color: #2E2E2E !important;
}

/* Dark mode text overrides */
[data-theme="dark"] .text-charcoal,
[data-theme="dark"] [class*="text-charcoal"] {
    color: #CCCCCC !important; /* Muted from #E8E8E8 */
}

[data-theme="dark"] .article-logo-box {
    background-color: #1E1E1E !important;
    border-color: #2A2A2A !important;
}

[data-theme="dark"] .text-gray-500,
[data-theme="dark"] .text-gray-400,
[data-theme="dark"] .text-gray-600 {
    color: #999999 !important;
}

/* Dark mode bg overrides */
[data-theme="dark"] .bg-bgLight {
    background-color: #1A1A1A !important;
}

[data-theme="dark"] .bg-pureWhite,
[data-theme="dark"] .bg-white {
    background-color: #242424 !important;
}

/* Dark mode borders */
[data-theme="dark"] .border-gray-200,
[data-theme="dark"] .border-gray-100 {
    border-color: #3A3A3A !important;
}

/* Dark mode tags */
[data-theme="dark"] .bg-red-50 {
    background-color: rgba(215, 38, 56, 0.15) !important;
}

[data-theme="dark"] .border-red-100,
[data-theme="dark"] .border-red-200 {
    border-color: rgba(215, 38, 56, 0.3) !important;
}

[data-theme="dark"] .bg-green-50 {
    background-color: rgba(46, 125, 50, 0.15) !important;
}

[data-theme="dark"] .border-green-200 {
    border-color: rgba(46, 125, 50, 0.3) !important;
}

[data-theme="dark"] .bg-gray-100 {
    background-color: #2E2E2E !important;
}

/* Dark mode btn-sweep (non-outline) */
[data-theme="dark"] .btn-sweep:not(.btn-sweep-outline) {
    background-color: #D72638 !important;
}

/* Dark mode scrollbar */
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1A1A1A;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #D72638;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #E63B4F;
}

/* Dark mode countdown widget */
[data-theme="dark"] .countdown-widget {
    background: linear-gradient(135deg, #242424 0%, #1A1A1A 100%) !important;
    border-color: rgba(215, 38, 56, 0.3) !important;
}

[data-theme="dark"] .countdown-digit {
    color: #E8E8E8;
}


/* =============================================
   THEME TOGGLE BUTTON
   ============================================= */
.theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid currentColor;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #333333;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: #D72638;
    border-color: #D72638;
    color: white;
    transform: scale(1.05);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    width: 20px;
    height: 20px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme="dark"] .theme-toggle {
    color: #E8E8E8;
    border-color: #3A3A3A;
}

[data-theme="dark"] .theme-toggle:hover {
    background: #D72638;
    border-color: #D72638;
    color: white;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="dark"] .theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg);
}


/* =============================================
   ACTIVE NAVBAR LINK
   ============================================= */
.nav-link-active {
    color: #D72638 !important;
    position: relative;
}

.nav-link-active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #D72638;
    border-radius: 1px;
    animation: navUnderline 0.3s ease forwards;
}

@keyframes navUnderline {
    from { width: 0; }
    to { width: 100%; }
}

.mobile-link-active {
    color: #D72638 !important;
    position: relative;
}

.mobile-link-active::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: #D72638;
    border-radius: 2px;
}


/* =============================================
   COUNTDOWN WIDGET
   ============================================= */
.countdown-widget {
    background: linear-gradient(135deg, #FFFFFF 0%, #F4F4F9 100%);
    border: 1px solid rgba(215, 38, 56, 0.15);
    border-radius: 24px;
    padding: 2rem 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.countdown-widget:hover {
    box-shadow: 0 20px 60px -15px rgba(215, 38, 56, 0.2);
    transform: translateY(-2px);
}

.countdown-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #D72638, #ff4757, #D72638);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 200% 50%; }
}

.countdown-digit-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 72px;
}

.countdown-digit {
    font-size: 2.5rem;
    font-weight: 900;
    color: #333333;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s ease;
}

.countdown-label {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: #999999;
}

.countdown-separator {
    font-size: 2.5rem;
    font-weight: 900;
    color: #D72638;
    line-height: 1;
    animation: pulse-colon 1s ease-in-out infinite;
    align-self: flex-start;
    padding-top: 0.1em;
}

@keyframes pulse-colon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Responsive countdown */
@media (max-width: 480px) {
    .countdown-digit {
        font-size: 1.8rem;
    }
    .countdown-separator {
        font-size: 1.8rem;
    }
    .countdown-digit-box {
        min-width: 52px;
    }
    .countdown-widget {
        padding: 1.5rem;
    }
}


/* =============================================
   FILTER ANIMATIONS
   ============================================= */
.filter-card {
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.filter-card.hidden-filtered {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

.filter-card.visible-filtered {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* No results message */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #999999;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}


/* =============================================
   COMPETITION CARD MINI COUNTDOWN
   ============================================= */
.comp-cd-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 48px;
}

.comp-cd-digit {
    font-size: 1.5rem;
    font-weight: 900;
    color: #333333;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.comp-cd-label {
    font-size: 0.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #999999;
}

.comp-cd-sep {
    font-size: 1.5rem;
    font-weight: 900;
    color: #D72638;
    line-height: 1;
    animation: pulse-colon 1s ease-in-out infinite;
    align-self: flex-start;
    padding-top: 0.05em;
}

[data-theme="dark"] .comp-cd-digit {
    color: #E8E8E8;
}

[data-theme="dark"] .competition-card {
    background: #242424 !important;
    border-color: #3A3A3A !important;
}

@media (max-width: 480px) {
    .comp-cd-digit {
        font-size: 1.2rem;
    }
    .comp-cd-sep {
        font-size: 1.2rem;
    }
    .comp-cd-box {
        min-width: 38px;
    }
}