/* ========================================
   Candy Contrast UI Theme
   Color Palette:
   - Background: #fff6f0 (Cream White)
   - Primary: #ff5c8a (Candy Pink)
   - Secondary: #5cc8ff (Fresh Blue)
   - Accent: #ffd93d (Bright Yellow)
   - Text: #333333
   ======================================== */

:root {
    --candy-bg: #fff6f0;
    --candy-primary: #ff5c8a;
    --candy-primary-dark: #e84575;
    --candy-secondary: #5cc8ff;
    --candy-secondary-dark: #45b5e8;
    --candy-accent: #ffd93d;
    --candy-accent-dark: #f5c92a;
    --candy-text: #333333;
    --candy-text-light: #666666;
    --candy-white: #ffffff;
    --candy-card-bg: #ffffff;
    --candy-shadow: 0 4px 15px rgba(255, 92, 138, 0.12);
    --candy-shadow-hover: 0 8px 30px rgba(255, 92, 138, 0.25);
    --candy-radius: 16px;
    --candy-radius-lg: 24px;
    --candy-radius-xl: 32px;
    --candy-gradient: linear-gradient(135deg, #ff5c8a 0%, #5cc8ff 100%);
    --candy-gradient-warm: linear-gradient(135deg, #ff5c8a 0%, #ffd93d 100%);
    --candy-gradient-cool: linear-gradient(135deg, #5cc8ff 0%, #a78bfa 100%);
}

/* ========================================
   Base Styles
   ======================================== */

body {
    background-color: var(--candy-bg) !important;
    color: var(--candy-text) !important;
}

/* ========================================
   Page Load Animations
   ======================================== */

@keyframes candyFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes candySlideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes candyScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes candyBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.candy-page-animate {
    animation: candyFadeIn 0.6s ease-out forwards;
}

/* ========================================
   Header - Candy Style
   ======================================== */

.candy-header {
    background: var(--candy-white);
    box-shadow: 0 2px 20px rgba(255, 92, 138, 0.1);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: candySlideDown 0.5s ease-out;
}

.candy-header__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.candy-header__logo {
    font-size: 28px;
    font-weight: 900;
    background: var(--candy-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -1px;
    transition: transform 0.2s ease;
    white-space: nowrap;
}

.candy-header__logo:hover {
    transform: scale(1.05);
}

.candy-header__logo span {
    display: inline-block;
    animation: candyBounce 2s ease-in-out infinite;
}

.candy-header__logo span:nth-child(2) { animation-delay: 0.1s; }
.candy-header__logo span:nth-child(3) { animation-delay: 0.2s; }

.candy-header__domain {
    font-size: 20px;
    font-weight: 800;
    color: var(--candy-primary);
    -webkit-text-fill-color: var(--candy-primary);
    margin-left: 10px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    letter-spacing: 0.5px;
    animation: none;
    vertical-align: middle;
    box-shadow: none;
}

.candy-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.candy-search__input {
    width: 100%;
    padding: 14px 50px 14px 20px;
    border: 2px solid transparent;
    border-radius: 50px;
    background: linear-gradient(var(--candy-bg), var(--candy-bg)) padding-box,
                var(--candy-gradient) border-box;
    font-size: 15px;
    color: var(--candy-text);
    transition: all 0.3s ease;
    outline: none;
}

.candy-search__input::placeholder {
    color: #999;
}

.candy-search__input:focus {
    box-shadow: 0 0 0 4px rgba(255, 92, 138, 0.15);
}

.candy-search__button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--candy-gradient);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.candy-search__button:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 92, 138, 0.4);
}

.candy-header__nav {
    display: flex;
    gap: 12px;
    align-items: center;
}

.candy-nav__link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 50px;
    background: var(--candy-bg);
    color: var(--candy-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.candy-nav__link:hover {
    background: var(--candy-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 92, 138, 0.3);
}

.candy-nav__link img {
    width: 20px;
    height: 20px;
}

/* ========================================
   Hero Banner
   ======================================== */

.candy-hero {
    background: var(--candy-gradient);
    border-radius: var(--candy-radius-xl);
    padding: 48px;
    margin: 32px 0;
    position: relative;
    overflow: hidden;
    animation: candyScaleIn 0.6s ease-out 0.2s both;
    min-height: 320px;
    display: flex;
    align-items: center;
}

.candy-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.candy-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 217, 61, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.candy-hero__content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.candy-hero__badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
}

.candy-hero__title {
    font-size: 42px;
    font-weight: 900;
    color: white;
    margin-bottom: 16px;
    line-height: 1.1;
    letter-spacing: -1px;
}

.candy-hero__desc {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 28px;
    line-height: 1.5;
}

.candy-hero__button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 36px;
    background: var(--candy-accent);
    color: var(--candy-text);
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 25px rgba(255, 217, 61, 0.4);
    text-decoration: none;
}

.candy-hero__button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 217, 61, 0.5);
}

.candy-hero__button:active {
    transform: translateY(-2px) scale(1.02);
}

.candy-hero__image {
    position: absolute;
    right: 48px;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    height: 300px;
    border-radius: var(--candy-radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.candy-hero__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   Section Headers
   ======================================== */

.candy-section {
    margin: 40px 0;
    animation: candyFadeIn 0.6s ease-out both;
}

.candy-section:nth-child(2) { animation-delay: 0.1s; }
.candy-section:nth-child(3) { animation-delay: 0.2s; }
.candy-section:nth-child(4) { animation-delay: 0.3s; }

.candy-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.candy-section__title {
    font-size: 28px;
    font-weight: 900;
    color: var(--candy-text);
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.5px;
}

.candy-section__title-icon {
    font-size: 32px;
}

.candy-section__more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--candy-bg);
    border-radius: 50px;
    color: var(--candy-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s ease;
}

.candy-section__more:hover {
    background: var(--candy-primary);
    color: white;
    transform: translateX(4px);
}

/* ========================================
   Category Pills
   ======================================== */

.candy-categories {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    animation: candyFadeIn 0.6s ease-out 0.3s both;
}

.candy-category-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 50px;
    background: var(--candy-white);
    color: var(--candy-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    box-shadow: var(--candy-shadow);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid transparent;
}

.candy-category-pill:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: var(--candy-shadow-hover);
}

.candy-category-pill--pink {
    background: linear-gradient(135deg, #ffe5ed 0%, #fff0f5 100%);
    color: var(--candy-primary);
}

.candy-category-pill--pink:hover {
    background: var(--candy-primary);
    color: white;
}

.candy-category-pill--blue {
    background: linear-gradient(135deg, #e5f5ff 0%, #f0f8ff 100%);
    color: var(--candy-secondary-dark);
}

.candy-category-pill--blue:hover {
    background: var(--candy-secondary);
    color: white;
}

.candy-category-pill--yellow {
    background: linear-gradient(135deg, #fff8e5 0%, #fffdf0 100%);
    color: #d4a800;
}

.candy-category-pill--yellow:hover {
    background: var(--candy-accent);
    color: var(--candy-text);
}

.candy-category-pill--purple {
    background: linear-gradient(135deg, #f3e8ff 0%, #faf5ff 100%);
    color: #9333ea;
}

.candy-category-pill--purple:hover {
    background: #a78bfa;
    color: white;
}

/* ========================================
   Game Cards Grid
   ======================================== */

.candy-games-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 20px;
    overflow: hidden;
}

@media (max-width: 1400px) {
    .candy-games-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 18px;
    }
}

@media (max-width: 1200px) {
    .candy-games-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

@media (max-width: 900px) {
    .candy-games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
}

@media (max-width: 600px) {
    .candy-games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* ========================================
   Game Card - Simplified Style
   ======================================== */

.candy-card {
    border-radius: var(--candy-radius);
    overflow: hidden;
    box-shadow: var(--candy-shadow);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-decoration: none;
    color: inherit;
    display: block;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #ffe5ed 0%, #e5f5ff 100%);
}

.candy-card:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: var(--candy-shadow-hover);
}

.content-games-item-img {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.content-games-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.candy-card:hover .content-games-item-img img {
    transform: scale(1.08);
}

.content-games-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    padding: 30px 12px 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.candy-card:hover .content-games-item-overlay {
    opacity: 1;
}

.content-games-item-title {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    background: linear-gradient(135deg, #ff6b9d 0%, #ffb8d0 50%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(255, 92, 138, 0.5);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.candy-card:nth-child(1) { animation-delay: 0.05s; }
.candy-card:nth-child(2) { animation-delay: 0.1s; }
.candy-card:nth-child(3) { animation-delay: 0.15s; }
.candy-card:nth-child(4) { animation-delay: 0.2s; }
.candy-card:nth-child(5) { animation-delay: 0.25s; }
.candy-card:nth-child(6) { animation-delay: 0.3s; }
.candy-card:nth-child(7) { animation-delay: 0.35s; }
.candy-card:nth-child(8) { animation-delay: 0.4s; }
.candy-card:nth-child(9) { animation-delay: 0.45s; }
.candy-card:nth-child(10) { animation-delay: 0.5s; }
.candy-card:nth-child(11) { animation-delay: 0.55s; }
.candy-card:nth-child(12) { animation-delay: 0.6s; }

/* ========================================
   Engagement Sections
   ======================================== */

.candy-hot-games {
    background: linear-gradient(135deg, #fff0f5 0%, #fff6f0 100%);
    border-radius: var(--candy-radius-lg);
    padding: 32px;
    margin: 32px 0;
    border: 2px solid rgba(255, 92, 138, 0.1);
}

.candy-for-you {
    background: linear-gradient(135deg, #fff8e5 0%, #fff6f0 100%);
    border-radius: var(--candy-radius-lg);
    padding: 32px;
    margin: 32px 0;
    border: 2px solid rgba(255, 217, 61, 0.1);
}

/* ========================================
   Footer - Candy Style
   ======================================== */

.candy-footer {
    background: var(--candy-white);
    padding: 40px 0;
    margin-top: 60px;
    box-shadow: 0 -2px 20px rgba(255, 92, 138, 0.08);
}

.candy-footer__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.candy-footer__copy {
    font-size: 14px;
    color: var(--candy-text-light);
}

.candy-footer__links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.candy-footer__link {
    color: var(--candy-text-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s ease;
}

.candy-footer__link:hover {
    color: var(--candy-primary);
}

/* ========================================
   Pagination - Candy Style
   ======================================== */

.candy-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.candy-pagination__btn {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 12px;
    background: var(--candy-white);
    color: var(--candy-text);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--candy-shadow);
    padding: 0 14px;
}

.candy-pagination__btn:hover {
    background: var(--candy-gradient);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--candy-shadow-hover);
}

.candy-pagination__btn.active {
    background: var(--candy-gradient);
    color: white;
    box-shadow: var(--candy-shadow-hover);
}

.candy-pagination__btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.candy-pagination__info {
    color: var(--candy-text-light);
    font-size: 14px;
    margin: 0 12px;
    font-weight: 600;
}

/* ========================================
   Ad Container Styling
   ======================================== */

.candy-ad-container {
    background: var(--candy-white);
    border-radius: var(--candy-radius);
    padding: 20px;
    margin: 24px 0;
    text-align: center;
    box-shadow: var(--candy-shadow);
}

.candy-ad-label {
    font-size: 12px;
    color: var(--candy-text-light);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
    .candy-hero {
        padding: 32px 24px;
        min-height: auto;
    }
    
    .candy-hero__title {
        font-size: 28px;
    }
    
    .candy-hero__desc {
        font-size: 15px;
    }
    
    .candy-hero__button {
        padding: 14px 28px;
        font-size: 16px;
    }
    
    .candy-hero__image {
        display: none;
    }
    
    .candy-header__container {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .candy-search {
        order: 3;
        max-width: 100%;
        width: 100%;
    }
    
    .candy-section__title {
        font-size: 22px;
    }
    
    .candy-hot-games,
    .candy-recently-played,
    .candy-for-you {
        padding: 20px;
    }
    
    .candy-footer__container {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.candy-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.candy-text-gradient {
    background: var(--candy-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.candy-hidden {
    display: none !important;
}
