/**
 * TANITIM - Main Application Styles
 * Centralized CSS for the entire application
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    /* ============================================
       Background Colors - Refined Slate Palette
       Tum arka plan renklerini buradan degistirin
       ============================================ */
    --color-bg-body: #111318;         /* Sayfa arka plani */
    --color-bg-card: #191c24;         /* Kart arka plani */
    --color-bg-elevated: #22262f;     /* Yukseltiimis alanlar, hover durumu */
    --color-bg-sidebar: #0e1016;      /* Sidebar arka plani */
    --color-bg-deep: #0a0c10;         /* Cok koyu alanlar (footer vs) */
    --color-bg-input: #0d0f14;        /* Input alanlari */
    --color-bg-overlay: rgba(0, 0, 0, 0.6); /* Modal overlay */

    /* ============================================
       Border Colors
       ============================================ */
    --color-border: rgba(255, 255, 255, 0.08);      /* Standart border */
    --color-border-light: rgba(255, 255, 255, 0.06); /* Hafif border */
    --color-border-strong: rgba(255, 255, 255, 0.12); /* Belirgin border */

    /* ============================================
       Brand Colors - Ana Marka Renkleri
       ============================================ */
    /* RGB degerleri - Tailwind opacity modifier icin (bg-brand-primary/20 gibi) */
    --color-brand-primary-rgb: 38 186 193;
    --color-brand-primary-dark-rgb: 30 154 160;
    --color-brand-primary-deeper-rgb: 24 122 127;
    --color-brand-primary-light-rgb: 77 212 219;
    --color-brand-primary-active-rgb: 32 165 171;
    /* HEX degerleri - inline style icin */
    --color-brand-primary: #26bac1;
    --color-brand-primary-dark: #1e9aa0;
    --color-brand-primary-deeper: #187a7f;
    --color-brand-primary-light: #4dd4db;
    --color-brand-primary-active: #20a5ab;
    /* Backward compat aliases */
    --color-brand-red: var(--color-brand-primary);
    --color-brand-red-dark: var(--color-brand-primary-dark);
    --color-brand-red-deeper: var(--color-brand-primary-deeper);
    --color-brand-red-light: var(--color-brand-primary-light);
    --color-brand-red-active: var(--color-brand-primary-active);
    --color-brand-amber: var(--color-brand-primary);
    --color-brand-amber-dark: var(--color-brand-primary-dark);
    --color-brand-emerald: #10b981;
    --color-brand-emerald-dark: #059669;
    --color-brand-blue: #3b82f6;
    --color-brand-blue-dark: #2563eb;
    --color-brand-purple: #8b5cf6;
    --color-brand-purple-dark: #7c3aed;
    --color-brand-orange: #f97316;
    --color-brand-cyan: #0891b2;

    /* ============================================
       Text Colors
       ============================================ */
    --color-text-primary: #f0f0f0;    /* Ana metin */
    --color-text-secondary: #a1a1aa;  /* Ikincil metin */
    --color-text-muted: #71717a;      /* Soluk metin */
    --color-text-dim: #6b7280;        /* Cok soluk metin */
    --color-text-faint: #4b5563;      /* En soluk metin */
    --color-text-bright: #e5e7eb;     /* Parlak metin */
    --color-text-light: #d1d5db;      /* Acik metin */
    --color-text-white: #ffffff;      /* Beyaz metin */

    /* ============================================
       Status Colors
       ============================================ */
    --color-status-active: #10b981;
    --color-status-ended: #9ca3af;
    --color-status-pending: #f59e0b;
}

/* ============================================
   Base Styles
   ============================================ */
html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg-body);
    color: var(--color-text-primary);
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

input,
textarea,
select,
button {
    outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

input:focus,
input:focus-visible,
input:focus-within,
textarea:focus,
textarea:focus-visible,
select:focus,
select:focus-visible,
button:focus,
button:focus-visible {
    outline: none !important;
    outline-width: 0 !important;
    outline-style: none !important;
    box-shadow: none !important;
    --tw-ring-shadow: none !important;
    --tw-ring-color: transparent !important;
    --tw-ring-offset-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}

.site-footer {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.main-content {
    overflow-x: hidden;
    max-width: 100%;
    min-width: 0;
}

/* ============================================
   Gradient Text
   ============================================ */
.gradient-text {
    background: linear-gradient(135deg, var(--color-brand-primary-light) 0%, var(--color-brand-primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Section Headers - Consistent Style
   ============================================ */
.section-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-body);
}

::-webkit-scrollbar-thumb {
    background: #353945;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2a2a3a;
}

/* ============================================
   Layout - Sidebar
   ============================================ */
@media (min-width: 1024px) {
    .main-content,
    .site-footer {
        margin-left: 280px;
    }

    .main-content.sidebar-collapsed,
    .site-footer.sidebar-collapsed {
        margin-left: 80px;
    }
}

/* ============================================
   Mobile - Global Fixes
   ============================================ */
@media (max-width: 639px) {
    .section-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .section-icon i,
    .section-icon svg {
        width: 16px;
        height: 16px;
    }

    /* Prevent any grid/flex from overflowing on mobile */
    main, section, .grid, [class*="flex"] {
        max-width: 100%;
    }
}

/* ============================================
   Filter Buttons
   ============================================ */
.filter-btn {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.filter-btn:hover {
    background: var(--color-bg-elevated);
    color: white;
    border-color: var(--color-border-strong);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--color-brand-red) 0%, var(--color-brand-red-dark) 100%);
    color: white;
    border-color: var(--color-brand-red);
    box-shadow: 0 0 20px rgba(38, 186, 193, 0.25);
}

/* ============================================
   Select Styling
   ============================================ */
select option {
    background: var(--color-bg-deep);
    color: white;
}

/* ============================================
   FAQ Accordion
   ============================================ */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
    padding-bottom: 1.25rem;
}

.faq-item.open {
    border-color: var(--color-brand-primary);
    background: rgba(38, 186, 193, 0.05);
}

/* ============================================
   Product Card Hover
   ============================================ */
.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-brand-primary);
    box-shadow: 0 12px 32px rgba(38, 186, 193, 0.15);
}

/* ============================================
   Countdown Box
   ============================================ */
.countdown-box {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1) 0%, rgba(0, 0, 0, 0.2) 100%);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

/* ============================================
   Status Badges
   ============================================ */
.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-status-active);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-ended {
    background: rgba(107, 114, 128, 0.15);
    color: var(--color-status-ended);
    border: 1px solid rgba(107, 114, 128, 0.25);
}

/* ============================================
   Podium Colors
   ============================================ */
.avatar-ring.gold {
    background: linear-gradient(135deg, var(--color-brand-primary-light) 0%, var(--color-brand-primary) 100%);
}

.avatar-ring.silver {
    background: linear-gradient(135deg, #e9d5ff 0%, #a855f7 100%);
}

.avatar-ring.bronze {
    background: linear-gradient(135deg, #fed7aa 0%, #f97316 100%);
}

.podium-rank-badge.gold {
    background: var(--color-brand-primary);
}

.podium-rank-badge.silver {
    background: #a855f7;
}

.podium-rank-badge.bronze {
    background: #f97316;
}

/* ============================================
   Pagination
   ============================================ */
.page-btn.active {
    background: var(--color-brand-red);
    border-color: var(--color-brand-red);
    color: white;
}

/* ============================================
   Winner Avatar Overlap
   ============================================ */
.winner-avatar {
    margin-left: -10px;
}

.winner-avatar:first-child {
    margin-left: 0;
}

/* ============================================
   Code Card Mockup
   ============================================ */
.code-card-mockup {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
    border: 2px solid #34d399;
    color: #34d399;
    font-family: monospace;
    transform: rotate(-5deg);
}

/* ============================================
   Skeleton Loading Animation
   ============================================ */
.skeleton-loading {
    background: linear-gradient(
        90deg,
        var(--color-bg-card) 25%,
        var(--color-bg-elevated) 50%,
        var(--color-bg-card) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite;
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   Particle Animation (Coin)
   ============================================ */
.particle {
    animation: particle 3s ease-in-out infinite;
}

.particle:nth-child(1) { animation-delay: 0s; }
.particle:nth-child(2) { animation-delay: 0.5s; }
.particle:nth-child(3) { animation-delay: 1s; }
.particle:nth-child(4) { animation-delay: 1.5s; }
.particle:nth-child(5) { animation-delay: 2s; }

@keyframes particle {
    0%, 100% { opacity: 0; transform: scale(0) translateY(0); }
    50% { opacity: 1; transform: scale(1) translateY(-20px); }
}

/* ============================================
   Search Results
   ============================================ */
#search-results.active {
    display: block;
}

/* ============================================
   Bounce Slow Animation
   ============================================ */
@keyframes bounce-slow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.animate-bounce-slow {
    animation: bounce-slow 3s ease-in-out infinite;
}

/* ============================================
   Float Animation
   ============================================ */
@keyframes float-gentle {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-8px) rotate(1deg); }
    66% { transform: translateY(-4px) rotate(-1deg); }
}

.animate-float-gentle {
    animation: float-gentle 4s ease-in-out infinite;
}

/* ============================================
   Line Clamp Utilities
   ============================================ */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   Card Glow Effects
   ============================================ */
.card-glow-red:hover {
    border-color: rgba(38, 186, 193, 0.4) !important;
    box-shadow: 0 0 30px rgba(38, 186, 193, 0.12), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.card-glow-amber:hover {
    border-color: rgba(38, 186, 193, 0.4) !important;
    box-shadow: 0 0 30px rgba(38, 186, 193, 0.1), 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ============================================
   Stories
   ============================================ */
.story-ring-new {
    background: linear-gradient(135deg, #26bac1, #1e9aa0, #8b5cf6, #1e9aa0, #26bac1);
    background-size: 300% 300%;
    animation: story-ring-rotate 3s linear infinite;
}

.story-ring-seen {
    background: rgba(255, 255, 255, 0.15);
}

@keyframes story-ring-rotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.stories-scroll::-webkit-scrollbar {
    display: none;
}

.stories-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.story-image-loading {
    opacity: 0;
    transition: opacity 0.3s;
}

/* ============================================
   Marquee Track
   ============================================ */
.marquee-track {
    /* temiz, border yok */
}

/* ============================================
   Quest History Filter
   ============================================ */
.qh-filter {
    background: var(--color-bg-card);
    border-color: var(--color-border);
    color: var(--color-text-muted);
}

.qh-filter:hover {
    background: var(--color-bg-elevated);
    color: var(--color-text-bright);
    border-color: var(--color-border-strong);
}

.qh-filter.active {
    background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%);
    color: white;
    border-color: #9333ea;
    box-shadow: 0 0 16px rgba(147, 51, 234, 0.2);
}

/* ============================================
   Bonus Filter Active
   ============================================ */
.bl-filter.active {
    background-color: var(--color-brand-red);
    color: white;
    box-shadow: 0 0 15px rgba(38, 186, 193, 0.3);
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .animate-marquee,
    .animate-float,
    .animate-pulse-glow,
    .animate-bounce-slow,
    .animate-float-gentle,
    .particle,
    .skeleton-loading {
        animation: none;
    }

    * {
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Raffle - Status Filter Button
   ============================================ */
.rf-status-btn.active {
    background: linear-gradient(135deg, #9333ea, #6b21a8);
    color: white;
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.3);
}

/* ============================================
   Raffle - Participants Scroll
   ============================================ */
.rf-participants-scroll::-webkit-scrollbar { width: 4px; }
.rf-participants-scroll::-webkit-scrollbar-track { background: transparent; }
.rf-participants-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
.rf-participants-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ============================================
   Raffle - Date Picker
   ============================================ */
.rf-dp-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0; pointer-events: none;
    transition: opacity .2s;
}
.rf-dp-overlay.active { opacity: 1; pointer-events: auto; }

.rf-dp-modal {
    position: fixed; left: 50%; top: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    z-index: 9999;
    width: 340px; max-width: 95vw; max-height: 90vh;
    overflow-y: auto;
    opacity: 0; pointer-events: none;
    transition: all .25s ease;
}
.rf-dp-modal.active {
    opacity: 1; pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.rf-dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.rf-dp-day {
    width: 100%; aspect-ratio: 1;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    border: 2px solid transparent;
    color: #e5e7eb;
}
.rf-dp-day:hover:not(.disabled):not(.empty) { background: rgba(147,51,234,0.15); }
.rf-dp-day.selected {
    background: linear-gradient(135deg, #9333ea, #6b21a8);
    color: white;
    border-color: rgba(147,51,234,0.5);
}
.rf-dp-day.today:not(.selected) { border-color: rgba(147,51,234,0.4); color: #c084fc; }
.rf-dp-day.disabled { opacity: 0.2; cursor: not-allowed; pointer-events: none; }
.rf-dp-day.empty { cursor: default; }

/* Scroll Wheels */
.rf-dp-wheel {
    position: relative; height: 150px; overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent);
}
.rf-dp-wheel-inner {
    position: absolute; width: 100%;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.rf-dp-wheel-item {
    height: 50px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700;
    color: rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all .15s;
    user-select: none;
}
.rf-dp-wheel-item.active { color: #c084fc; font-size: 26px; }
.rf-dp-wheel-item.disabled { opacity: 0.1; cursor: not-allowed; }
.rf-dp-wheel-highlight {
    position: absolute; top: 50px; left: 0; right: 0; height: 50px;
    border-top: 1px solid rgba(147,51,234,0.3);
    border-bottom: 1px solid rgba(147,51,234,0.3);
    background: rgba(147,51,234,0.05);
    border-radius: 8px;
    pointer-events: none;
}
