/* Home Page Styles - CDN Cacheable */
/* Version: 1.0.0 */

/* Home Container - No padding since we have custom header */
.main-content {
    padding: 0;
}

.home-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 18px 24px 18px;
    overflow-y: auto;
    flex: 1;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.home-container::-webkit-scrollbar {
    display: none;
}

/* ============================================
   Custom Header
   ============================================ */
.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background-color: var(--color-bg-primary);
}

.header-logo {
    display: flex;
    align-items: center;
    width: 133px;
    height: 19.37px;
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    background-color: #CC4228;
    border: 1.5px solid rgba(204, 66, 40, 0.25);
    border-radius: 22px;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.login-btn:hover {
    background-color: #B33A22;
}

/* ============================================
   Skeleton Loader
   ============================================ */
.user-header-skeleton {
    position: relative;
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 0;
    width: auto;
    height: 50px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(90deg, #2a2a2a 25%, #333333 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border: 2px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.skeleton-coins-badge {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 1px;
    padding: 0 16px 0 12px;
    width: auto;
    min-width: 70px;
    height: 44px;
    background: linear-gradient(98.65deg, #2E323E -8.36%, #1C1F28 108.05%);
    border-radius: 22px 0px 0px 22px;
    box-sizing: border-box;
    direction: ltr;
    margin-right: -12px;
    z-index: 1;
}

.skeleton-energy-badge {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 12px 0 16px;
    width: auto;
    min-width: 80px;
    height: 38px;
    background: linear-gradient(98.65deg, #2E323E -8.36%, #1C1F28 108.05%);
    border-radius: 0;
    box-sizing: border-box;
    direction: ltr;
    margin-left: -14px;
    z-index: 0;
}

.skeleton-coin-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(90deg, #3a3a3a 25%, #4a4a4a 50%, #3a3a3a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    flex-shrink: 0;
}

.skeleton-energy-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(90deg, #3a3a3a 25%, #4a4a4a 50%, #3a3a3a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    flex-shrink: 0;
}

.skeleton-text {
    height: 14px;
    width: 55px;
    border-radius: 7px;
    background: linear-gradient(90deg, #3a3a3a 25%, #4a4a4a 50%, #3a3a3a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

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

/* ============================================
   Logged-in User Header Info
   ============================================ */
.user-header-info {
    position: relative;
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    gap: 0;
    width: auto;
    height: 58px;
}

.user-coins-badge {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 1px;
    padding: 0 16px 0 12px;
    width: auto;
    min-width: 70px;
    height: 44px;
    background: linear-gradient(98.65deg, #2E323E -8.36%, #1C1F28 108.05%);
    border-radius: 22px 0px 0px 22px;
    box-sizing: border-box;
    direction: ltr;
    margin-right: -12px;
    z-index: 1;
    transition: min-width 0.3s ease;
    border: 1.5px solid transparent;
    background-image: 
        linear-gradient(98.65deg, #2E323E -8.36%, #1C1F28 108.05%),
        linear-gradient(to bottom, #1D1F25, #3F4556);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
}

.coin-icon-header {
    width: 27px;
    height: 27px;
    flex-shrink: 0;
}

.coin-amount {
    font-family: 'Vazirmatn', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #FFFFFF;
    flex: 0 1 auto;
    white-space: nowrap;
    overflow: visible;
    min-width: fit-content;
}

/* Energy Badge Styles */
.user-energy-badge {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 1px;
    padding: 0 16px 0 12px;
    width: auto;
    min-width: 70px;
    height: 44px;
    background: linear-gradient(98.65deg, #2E323E -8.36%, #1C1F28 108.05%);
    border-radius: 0;
    box-sizing: border-box;
    direction: ltr;
    margin-right: -12px;
    z-index: 0;
    transition: min-width 0.3s ease;
    border: 1.5px solid transparent;
    border-left: none;
    border-right: none;
    background-image: 
        linear-gradient(98.65deg, #2E323E -8.36%, #1C1F28 108.05%),
        linear-gradient(to bottom, #1D1F25, #3F4556);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
}

.energy-icon-header {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.energy-amount {
    font-family: 'Vazirmatn', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #FFFFFF;
    flex: 0 1 auto;
    white-space: nowrap;
    overflow: visible;
    min-width: fit-content;
}

.user-avatar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: #D9D9D9;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-fast);
    opacity: 0.99;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.user-avatar-link:hover {
    opacity: 1;
    transform: scale(1.05);
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ============================================
   Hero Banner
   ============================================ */
.hero-banner {
    position: relative;
    width: 100%;
    height: 167px;
    min-height: 167px;
    flex-shrink: 0;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   Games Section
   ============================================ */
.games-section {
    position: relative;
    width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    overflow: visible;
    flex-shrink: 0;
    border-radius: 22px 22px 16px 22px;
    border: 1.5px solid transparent;
    background-image: 
        linear-gradient(#1F2229, #1F2229),
        linear-gradient(to bottom, #1D1F25, #3F4556);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
}

.games-scroll {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 120px;
    min-height: 120px;
    margin: 0;
    background: transparent;
    border-radius: 20.5px 20.5px 14.5px 20.5px;
    display: flex;
    align-items: flex-end;
    gap: 14px;
    padding: 5px 14px 12px 14px;
    overflow-x: auto;
    overflow-y: visible;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
}

.games-scroll::-webkit-scrollbar {
    display: none;
}

.game-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    min-width: 72px;
}

.game-image-container {
    position: relative;
    width: 75px;
    height: 75px;
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    /* transform: translateY(-38px); */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.game-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
}

.game-name {
    font-family: 'Vazirmatn', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 16px;
    display: flex;
    align-items: center;
    text-align: center;
    color: #FFFFFF;
    white-space: nowrap;
    /* margin-bottom: 2px; */
}

.game-multiplier {
    display: flex;
    align-items: center;
    gap: 2px;
    font-family: 'Vazirmatn', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 10px;
    line-height: 16px;
    color: rgba(255, 255, 255, 0.7);
}

.coin-icon {
    width: 13px;
    height: 13px;
}

/* Loading State */
.games-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 400;
}

.games-skeleton {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    width: 100%;
    height: 100%;
    padding: 5px 14px 12px 14px;
    overflow: hidden;
}

.game-skeleton-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    min-width: 72px;
}

.game-skeleton-image {
    width: 75px;
    height: 75px;
    border-radius: 12px 12px 12px 12px;
    margin-bottom: 0px;
    background: linear-gradient(90deg, #2a2a2a 25%, #333333 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    flex-shrink: 0;
}

.game-skeleton-title {
    width: 56px;
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg, #3a3a3a 25%, #4a4a4a 50%, #3a3a3a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-top: 2px;
}

.games-error {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #CC4228;
    font-size: 14px;
    font-weight: 400;
    text-align: center;
    padding: 0 20px;
}

/* ============================================
   Raffle Section
   ============================================ */
.raffle-section {
    position: relative;
    width: 100%;
    height: 167px;
    min-height: 167px;
    flex-shrink: 0;
    border-radius: 15px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    padding: 20px;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.raffle-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.raffle-bg-decoration {
    display: none;
}

.raffle-content {
    flex: 1;
    text-align: right;
    z-index: 1;
}

.raffle-title {
    font-size: 16px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 4px;
}

.raffle-date {
    font-size: 14px;
    font-weight: 400;
    color: #FFFFFF;
    opacity: 0.9;
    margin-bottom: 12px;
}

.raffle-prize {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.prize-amount {
    font-size: 24px;
    font-weight: 700;
    color: #FFFFFF;
}

.prize-label {
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF;
    opacity: 0.9;
}

/* ============================================
   Action Buttons
   ============================================ */
.action-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
    flex-shrink: 0;
}

.action-btn {
    flex: 1;
    height: auto;
    aspect-ratio: 1;
    border-radius: 15px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: none;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    padding-bottom: 8px;
}

.action-btn span {
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

/* ============================================
   Animations
   ============================================ */
.hero-banner,
.games-section,
.raffle-section,
.action-buttons {
    animation: fadeInUp 0.4s ease;
    animation-fill-mode: both;
}

.hero-banner {
    animation-delay: 0.1s;
}

.games-section {
    animation-delay: 0.2s;
}

.raffle-section {
    animation-delay: 0.3s;
}

.action-buttons {
    animation-delay: 0.4s;
}

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

/* ============================================
   Energy Purchase Popup
   ============================================ */
.energy-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.energy-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.energy-popup {
    background: linear-gradient(180deg, #1F2229 0%, #1A1D23 100%);
    border-radius: 24px;
    padding: 24px 18px;
    width: 100%;
    max-width: 400px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1.5px solid rgba(63, 69, 86, 0.5);
}

.energy-popup-overlay.active .energy-popup {
    transform: scale(1);
}

.energy-popup-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
}

.energy-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.energy-popup-title {
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 28px;
    color: #FFFFFF;
    text-align: center;
    margin-bottom: 24px;
}

/* Energy Expiration Timer */
.energy-expiration-timer {
    background: linear-gradient(180deg, rgba(52, 152, 219, 0.15) 0%, rgba(52, 152, 219, 0.05) 100%);
    border: 1.5px solid rgba(52, 152, 219, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 0 0 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.energy-timer-label {
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 500;
    font-size: 13px;
    line-height: 20px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.energy-timer-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 26px;
    color: #3498DB;
    direction: ltr;
}

.energy-timer-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.energy-timer-expired {
    color: #4CAF50;
    font-size: 14px;
    font-weight: 600;
}

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

.energy-packages {
    display: flex;
    flex-direction: row;
    gap: 12px;
    justify-content: space-between;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.energy-packages::-webkit-scrollbar {
    display: none;
}

.energy-package {
    background: linear-gradient(98.65deg, #2E323E -8.36%, #1C1F28 108.05%);
    border-radius: 16px;
    border: 1.5px solid transparent;
    background-image: 
        linear-gradient(98.65deg, #2E323E -8.36%, #1C1F28 108.05%),
        linear-gradient(to bottom, #1D1F25, #3F4556);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: default;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    flex: 1;
    min-width: 110px;
    max-width: 130px;
}

.energy-package::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(52, 152, 219, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.energy-package:hover::before {
    opacity: 1;
}

.energy-package:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.energy-package-image {
    width: 100%;
    height: 110px;
    flex-shrink: 0;
    border-radius: 12px;
    background: radial-gradient(circle at center, rgba(30, 90, 138, 0.3) 0%, transparent 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
    position: relative;
}

.energy-package-image img {
    width: 82px;
    height: 100%;
    max-height: 110px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(52, 152, 219, 0.4));
    margin: 0 auto;
}

.energy-package-amount-wrapper {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    width: 100%;
}

.energy-package-amount-shadow {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 82px;
    height: 21px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0px 0px 8px 8px;
    z-index: 1;
}

.energy-package-amount {
    position: relative;
    padding: 2px 12px;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 22px;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(52, 152, 219, 0.6);
    z-index: 2;
}

.energy-package-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    text-align: center;
    width: 100%;
}

.energy-package-prices {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    width: 100%;
}

.energy-package-original-price {
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 400;
    font-size: 11px;
    line-height: 16px;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: line-through;
}

.energy-package-price {
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.energy-package-price-value {
    color: #4CAF50;
}

.energy-package-buy-btn {
    width: 100%;
    padding: 8px 12px;
    background: linear-gradient(180deg, #CC4228 0%, #B33A22 100%);
    border: 1.5px solid rgba(204, 66, 40, 0.25);
    border-radius: 12px;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 20px;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(204, 66, 40, 0.3);
    position: relative;
    z-index: 10;
}

.energy-package-buy-btn:hover {
    background: linear-gradient(180deg, #D94B2E 0%, #C43F26 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(204, 66, 40, 0.4);
}

.energy-package-buy-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(204, 66, 40, 0.3);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.energy-package:active {
    transform: scale(0.98);
}

/* Energy Popup Error Message */
.energy-popup-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(204, 66, 40, 0.15);
    border: 1.5px solid rgba(204, 66, 40, 0.5);
    border-radius: 12px;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 500;
    font-size: 13px;
    line-height: 20px;
    color: #FF6B6B;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.energy-popup-error.show {
    opacity: 1;
    transform: translateY(0);
}
