:root {
    --primary-color: #4a90e2;
    --secondary-color: #50e3c2;
    --background-color: #f0f2f5;
    --text-color: #333;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

html {
    overflow-x: clip;
    /* clip is safer than hidden — doesn't create a scroll container */
}

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

@keyframes logoShine {
    0% {
        mask-position: 200% center;
        -webkit-mask-position: 200% center;
    }

    100% {
        mask-position: -100% center;
        -webkit-mask-position: -100% center;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f0f5;
    color: var(--text-color);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: clip;
    overflow-y: auto;
    width: 100%;
    position: relative;
}

/* Animated mesh gradient background — homepage only */
body.page-home::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background:
        radial-gradient(ellipse 600px 600px at 10% 20%, rgba(108, 92, 231, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 85% 15%, rgba(162, 155, 254, 0.10) 0%, transparent 70%),
        radial-gradient(ellipse 550px 550px at 70% 75%, rgba(253, 121, 168, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 450px 450px at 20% 80%, rgba(0, 184, 148, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 400px 400px at 50% 50%, rgba(116, 185, 255, 0.06) 0%, transparent 70%);
    animation: meshFloat 20s ease-in-out infinite alternate;
}

/* Subtle dot pattern overlay — homepage only */
body.page-home::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: radial-gradient(circle, rgba(108, 92, 231, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

@keyframes meshFloat {
    0% {
        background-position: 0% 0%, 100% 0%, 70% 100%, 0% 100%, 50% 50%;
    }

    100% {
        background-position: 20% 30%, 80% 25%, 60% 60%, 30% 70%, 45% 45%;
    }
}



.text-justify {
    text-align: justify;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    box-sizing: border-box;
}

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

.logo {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.logo a:hover {
    transform: scale(1.05);
}

.logo img {
    height: 100px;
    width: auto;
    display: block;
    position: relative;
    z-index: 10;

    /* Gradient maske ile parlama efekti */
    mask: linear-gradient(-60deg, #000 30%, #00000055, #fff 70%) right / 300% 100%;
    -webkit-mask: linear-gradient(-60deg, #000 30%, #00000055, #fff 70%) right / 300% 100%;

    /* Animasyonu uygula */
    animation: logoShine 3s infinite;
    -webkit-animation: logoShine 3s infinite;

    /* Performans optimizasyonu */
    will-change: mask-position;
}

.logo img:hover {
    animation-duration: 1.5s;
    -webkit-animation-duration: 1.5s;
}

/* Logo Shine Keyframes */
@keyframes logoShine {
    0% {
        mask-position: 140% 140%;
        -webkit-mask-position: 140% 140%;
    }

    100% {
        mask-position: -20% -20%;
        -webkit-mask-position: -20% -20%;
    }
}

@-webkit-keyframes logoShine {
    0% {
        -webkit-mask-position: 140% 140%;
    }

    100% {
        -webkit-mask-position: -20% -20%;
    }
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.card {
    background: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Homepage category cards — gradient style */
.page-home .cards-grid .card {
    background: linear-gradient(135deg, var(--gradient-start, #6c5ce7), var(--gradient-end, #a29bfe));
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    padding: 32px 25px 28px;
    box-shadow: 0 8px 32px var(--shadow-color, rgba(0, 0, 0, 0.15)),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    color: white;
}

/* Mix Card */
.card-mixed {
    grid-column: 1 / -1;
    background: linear-gradient(-45deg, #2c3e50, #000000, #434343, #2c3e50);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: white;
    margin-bottom: 20px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    height: 180px;
    /* Taller than normal cards */
    display: flex;
    flex-direction: row;
    /* Horizontal layout */
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 0 40px;
}

.card-mixed:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.card-mixed .card-icon {
    font-size: 3rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    width: 80px;
    height: 80px;
    margin-bottom: 0;
    margin-right: 20px;
    border-radius: 20px;
    /* Square-ish */
}

.card-mixed .card-content {
    flex: 1;
}

.card-mixed .card-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: white;
}

.card-mixed .card-desc {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Diagonal shine sweep — only on special cards (Karışık, Bayraklar, IQ) */
.card-mixed::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.12) 45%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.12) 55%, transparent 60%);
    animation: cardShine 5s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* Decorative circle — only on special cards */
.card-mixed::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}



@keyframes cardShine {

    0%,
    75% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(100%);
    }
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.page-home .cards-grid .card:hover {
    transform: translateY(-8px) scale(1.025);
    box-shadow: 0 20px 50px var(--shadow-color, rgba(0, 0, 0, 0.25)),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.card-icon {
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: white;
    background: linear-gradient(135deg, var(--gradient-start, var(--primary-color)), var(--gradient-end, #2980b9));
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 15px var(--shadow-color, rgba(74, 144, 226, 0.3));
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Homepage category cards — glassmorphism icon */
.page-home .cards-grid .card-icon {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 72px;
    height: 72px;
    border-radius: 22px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

.card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.page-home .cards-grid .card:hover .card-icon {
    transform: scale(1.12) rotate(5deg);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Category Colors Palette */
/* Category Colors - Fallbacks or overrides if needed */
/* Removed hardcoded nth-child colors in favor of PHP-injected variables */

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0;
    color: #333;
}

/* Homepage category cards — white text */
.page-home .cards-grid .card-title {
    font-size: 1.15rem;
    margin-bottom: 6px;
    color: #fff;
    position: relative;
    z-index: 2;
    letter-spacing: 0.2px;
}

.page-home .cards-grid .card-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    position: relative;
    z-index: 2;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
    text-align: left;
    width: 100%;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    color: #2c3e50;
    font-family: inherit;
    appearance: none;
    cursor: pointer;
}

.form-control:focus {
    border-color: #6c5ce7;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

/* Quiz UI */
.quiz-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--glass-shadow);
    max-width: 800px;
    width: 100%;
    margin: 20px auto;
}

.options-grid {
    display: grid;
    gap: 15px;
    margin-top: 30px;
}

.option-btn {
    padding: 15px 20px;
    border: 2px solid transparent;
    /* Better for sizing */
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
    transition: all 0.2s;
    outline: none;
}

.option-btn:hover {
    background: #fff;
    transform: translateX(5px);
}

.option-btn.selected {
    background: #e3f2fd;
    border-color: var(--primary-color);
}

.option-btn.correct {
    background-color: #d4edda !important;
    border-color: #28a745 !important;
    color: #155724;
}

.option-btn.wrong {
    background-color: #f8d7da !important;
    border-color: #dc3545 !important;
    color: #721c24;
}

.timer {
    font-size: 1.2rem;
    font-weight: bold;
    color: #dc3545;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s;
}

.action-btn:hover {
    background: #357abd;
}

/* Crypto Ticker - Enhanced */
.crypto-container {
    width: 100%;
    height: 70px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    position: relative;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.crypto-track {
    display: flex;
    align-items: center;
    gap: 40px;
    /* Adjust speed: 50 items * 2 = 100 items. Slower speed for readability */
    animation: cryptoScroll 120s linear infinite;
    white-space: nowrap;
    padding-left: 20px;
}

/* Pause on hover */
.crypto-container:hover .crypto-track {
    animation-play-state: paused;
}

@keyframes cryptoScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.crypto-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 600;
}

.c-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.c-symbol {
    color: #7f8c8d;
    font-weight: 700;
    font-size: 0.85rem;
}

.c-price {
    font-family: 'Roboto Mono', monospace;
    /* Monospace for numbers looks pro */
    color: #2d3436;
}

.c-change {
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.c-change.positive {
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
}

.c-change.negative {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .crypto-container {
        height: 60px;
        border-radius: 0;
        /* Full width feel on mobile */
        margin-left: -15px;
        /* Offset container padding */
        margin-right: -15px;
        width: calc(100% + 30px);
        margin-bottom: 20px;
    }

    .crypto-track {
        gap: 25px;
        animation-duration: 90s;
        /* Slightly faster on small screens or keep slow */
    }

    .crypto-item {
        font-size: 0.85rem;
    }
}

/* --- RESTORED STYLES (News, Weather, Ads) --- */

/* Ads */
.ads-banner {
    width: 100%;
    height: 90px;
    background: rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #999;
    text-align: center;
}

@media (max-width: 768px) {
    .ads-banner {
        height: 60px;
        /* Smaller height on mobile */
        font-size: 0.8rem;
        margin-bottom: 20px;
    }
}

/* Daily News Section */
.daily-news-container {
    background: #ffffff;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    /* Soft corporate shadow */
    position: relative;
    overflow: hidden;
    border-left: 5px solid #e17055;
    /* Accent color */
}

.daily-news-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.news-icon-wrapper {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #e17055, #fab1a0);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    margin-right: 15px;
    box-shadow: 0 4px 10px rgba(225, 112, 85, 0.3);
}

.daily-news-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #2d3436;
    font-weight: 700;
}

.daily-news-list {
    display: flex;
    flex-direction: column;
    /* Fixed height for marquee effect */
    height: 400px;
    overflow: hidden;
    position: relative;
    /* Mask/fade at bottom for smooth exit */
    mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
}

.news-track {
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: marqueeDown 60s linear infinite;
}

/* Pause scroll on hover */
.daily-news-list:hover .news-track {
    animation-play-state: paused;
}

@keyframes marqueeDown {
    0% {
        transform: translateY(-50%);
    }

    100% {
        transform: translateY(0);
    }

    /* Start halfway down (2nd copy) and slide down to 0 (1st copy) for seamless loop */
}

.news-item {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.news-item:hover {
    background: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transform: translateX(5px);
    border-left-color: #fab1a0;
}

.news-content h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #2d3436;
    font-weight: 600;
    line-height: 1.3;
}

.news-content p {
    margin: 0;
    font-size: 0.95rem;
    color: #636e72;
    line-height: 1.5;
}

/* Enhanced visibility for mobile */
@media (max-width: 768px) {
    .daily-news-container {
        padding: 20px;
    }

    .daily-news-header h3 {
        font-size: 1.2rem;
    }

    .news-content h4 {
        font-size: 1rem;
    }

    .news-content p {
        font-size: 0.9rem;
    }
}

/* New Item Blinking Animation */
.news-item.is-new {
    animation: blinkBackground 2s ease-in-out 3;
    /* Blinks 3 times */
    border-left-color: #00b894;
    /* distinguish new items with green border too */
}

@keyframes blinkBackground {
    0% {
        background-color: #f9f9f9;
    }

    50% {
        background-color: #ffeaa7;
    }

    /* Soft yellow/gold tint */
    100% {
        background-color: #f9f9f9;
    }
}

/* Weather Section */
.weather-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.weather-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.weather-card:hover {
    transform: translateY(-3px);
}

.weather-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(255, 154, 158, 0.3));
}

/* Custom icon colors based on type */
.weather-icon .fa-sun {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    -webkit-background-clip: text;
    background-clip: text;
}

.weather-icon .fa-cloud {
    background: linear-gradient(135deg, #bdc3c7, #2c3e50);
    -webkit-background-clip: text;
    background-clip: text;
}

.weather-icon .fa-cloud-rain {
    background: linear-gradient(135deg, #3498db, #2980b9);
    -webkit-background-clip: text;
    background-clip: text;
}

.weather-icon .fa-snowflake {
    background: linear-gradient(135deg, #a8e6cf, #dcedc1);
    -webkit-background-clip: text;
    background-clip: text;
}

.city-name {
    font-size: 0.9rem;
    color: #636e72;
    font-weight: 600;
    margin-bottom: 2px;
}

.city-temp {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d3436;
}

.spin-slow {
    animation: spin 8s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 600px) {
    .weather-container {
        grid-template-columns: repeat(2, 1fr);
        /* 2x2 on mobile */
    }
}