/**
 * ============================================
 * BASE CSS - Core Layout & Structure
 * ============================================
 * CSS dasar untuk struktur dan layout website
 * Tidak termasuk warna - warna diatur di theme CSS
 */

/* ==========================================
   CSS RESET & DEFAULTS
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.4;
    font-size: 14px;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================
   HEADER
   ========================================== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: nowrap;
    min-height: 48px;
}

.menu-btn {
    background: none;
    border: none;
    color: white;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-btn svg {
    width: 22px;
    height: 22px;
}

.logo-container {
    flex-shrink: 0;
}

.logo-container img {
    height: 28px;
    width: auto;
}

/* ==========================================
   SOCIAL ICONS
   ========================================== */
.social-icons {
    display: none;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.social-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.social-icon.telegram {
    background: #0088CC;
}

.social-icon.whatsapp {
    background: #25D366;
}

/* ==========================================
   ANNOUNCEMENT TICKER
   ========================================== */
.announcement-ticker {
    flex: 1;
    overflow: hidden;
    margin: 0 4px;
    font-size: 11px;
    min-width: 0;
}

.announcement-ticker span {
    display: inline-block;
    white-space: nowrap;
    animation: ticker 20s linear infinite;
}

@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ==========================================
   FAST DEPOSIT BUTTON
   ========================================== */
.fast-deposit-btn {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

.fast-deposit-btn svg {
    width: 12px;
    height: 12px;
}

/* ==========================================
   USER BALANCE HEADER
   ========================================== */
.user-balance-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    margin-left: auto; /* Push to right on mobile */
    flex-shrink: 0;
}

.user-balance-header .amount {
    font-weight: 700;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
.main-content {
    padding-top: 56px;
    padding-bottom: 70px;
    min-height: 100vh;
}

/* Inner Page Styles */
.inner-page .main-content {
    background: linear-gradient(180deg, #0a0a0f 0%, #111118 50%, #0d0d0d 100%);
}

/* Hide announcement ticker in header for inner pages on mobile */
.inner-page .announcement-ticker {
    display: none;
}

/* Desktop only elements - hidden on mobile */
.desktop-only {
    display: none;
}

/* Inner Page Header (Running Text only) */
.inner-page-header {
    margin-bottom: 0;
}

.inner-page-header .running-text-container {
    background: #1a1a1a;
    padding: 10px 12px;
    border-bottom: 1px solid #2a2a2a;
}

.inner-page-header .running-text {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
}

.inner-page-header .running-text .icon {
    color: #22c55e;
    flex-shrink: 0;
}

.inner-page-header .running-text .text-wrapper {
    overflow: hidden;
    flex: 1;
}

.inner-page-header .running-text .text {
    display: inline-block;
    white-space: nowrap;
    color: #9ca3af;
    font-size: 13px;
    padding-left: 100%;
    animation: runningText 35s linear infinite;
}

.inner-page-header .running-text .text:hover {
    animation-play-state: paused;
}

@keyframes runningText {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ==========================================
   FOOTER
   ========================================== */
.footer,
.site-footer {
    padding: 24px 16px;
    text-align: center;
    margin-top: 20px;
}

.footer-providers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-providers img {
    height: 24px;
    width: auto;
    opacity: 0.6;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

.footer-providers img:hover {
    opacity: 1;
    filter: grayscale(0%);
}

.footer-divider {
    height: 1px;
    margin: 16px 0;
}

.footer-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.footer-badges img {
    height: 32px;
    width: auto;
}

.age-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 12px;
}

.footer-seo {
    padding: 16px;
    border-radius: 8px;
    text-align: left;
    margin-bottom: 16px;
}

.footer-seo h2 {
    font-size: 14px;
    margin-bottom: 8px;
}

.footer-seo p {
    font-size: 12px;
    line-height: 1.6;
    margin-bottom: 8px;
}

.footer-seo p:last-child {
    margin-bottom: 0;
}

.footer-bar {
    font-size: 11px;
}

/* ==========================================
   BOTTOM NAVIGATION
   ========================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 10px 16px 12px;
    background: #161616;
    border-top: 1px solid #303030;
}

.bottom-nav-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

.bottom-nav-buttons .btn,
.bottom-nav-buttons a,
.bottom-nav-buttons button {
    flex: 1 !important;
    padding: 14px 20px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    text-align: center !important;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 48px;
    font-family: inherit;
}

.bottom-nav-buttons .btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    border: none !important;
}

.bottom-nav-buttons .btn-primary {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

.bottom-nav-buttons .btn-primary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}

.btn-nav {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Logged in bottom nav */
.bottom-nav-logged {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.nav-item svg {
    width: 22px;
    height: 22px;
}

.nav-item.deposit-center {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    margin-top: -20px;
    justify-content: center;
    padding: 0;
}

.nav-item.deposit-center svg {
    width: 24px;
    height: 24px;
}

.nav-item.deposit-center span {
    display: none;
}

/* ==========================================
   CONTAINER
   ========================================== */
.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0;
}

/* ==========================================
   SIDE MENU
   ========================================== */
.side-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    z-index: 2000;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.side-menu.active {
    left: 0;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.menu-header {
    padding: 20px 16px;
}

.menu-header img {
    height: 32px;
}

.menu-items {
    padding: 12px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.menu-item svg {
    width: 20px;
    height: 20px;
}

.menu-divider {
    height: 1px;
    margin: 8px 0;
}

/* ==========================================
   DESKTOP USER ACTIONS
   ========================================== */
.desktop-user-actions {
    display: none;
    align-items: center;
    gap: 10px;
}

.btn-action-desktop {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-action-desktop svg {
    width: 16px;
    height: 16px;
}

/* ==========================================
   USER DROPDOWN
   ========================================== */
.user-dropdown {
    position: relative;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    font-family: inherit;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    transition: all 0.2s;
}

.user-name {
    display: none;
}

.user-dropdown-btn svg {
    display: none;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1001;
    overflow: hidden;
}

.user-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 13px;
    transition: all 0.2s;
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.dropdown-divider {
    height: 1px;
    margin: 4px 0;
}

/* Dropdown Header */
.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.dropdown-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dropdown-username {
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-role {
    font-size: 11px;
}

/* ==========================================
   ALERTS
   ========================================== */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.alert svg {
    flex-shrink: 0;
}

/* ==========================================
   DESKTOP NAV
   ========================================== */
.desktop-nav,
.desktop-auth {
    display: none;
}

/* Mobile only elements */
.mobile-only {
    display: flex;
}

/* ==========================================
   BUTTON ANIMATIONS
   ========================================== */
.btn-login-desktop::after,
.btn-register-desktop::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-login-desktop:hover::after,
.btn-register-desktop:hover::after {
    left: 100%;
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.refresh-icon {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.user-balance-header:hover .refresh-icon {
    opacity: 1;
}

/* ==========================================
   RESPONSIVE - TABLET
   ========================================== */
@media (min-width: 480px) {
    .social-icons {
        display: flex;
    }

    .fast-deposit-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    .fast-deposit-btn svg {
        width: 14px;
        height: 14px;
    }

    .user-balance-header {
        padding: 8px 12px;
        font-size: 13px;
        gap: 6px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
}

/* ==========================================
   RESPONSIVE - DESKTOP
   ========================================== */
@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
    }

    .main-content {
        padding-top: 64px;
        padding-bottom: 30px;
    }

    /* Desktop Header - Fixed Layout */
    .header-top {
        max-width: 1400px;
        margin: 0 auto;
        padding: 10px 24px;
        gap: 16px;
        flex-wrap: nowrap;
        min-height: 60px;
    }

    .logo-container {
        flex-shrink: 0;
    }

    .logo-container img {
        height: 36px;
    }

    /* Social icons on desktop */
    .social-icons {
        display: flex;
        flex-shrink: 0;
    }

    /* Announcement ticker - flexible width */
    .announcement-ticker {
        flex: 0 1 300px;
        min-width: 150px;
        font-size: 12px;
        margin: 0 8px;
    }

    /* Show announcement ticker in header for inner pages on desktop */
    .inner-page .announcement-ticker {
        display: block;
    }

    /* Hide inner page header on desktop (keep ticker in main header) */
    .inner-page-header {
        display: none;
    }

    /* Show desktop-only elements */
    .desktop-only {
        display: flex;
    }

    /* Desktop Navigation - proper spacing */
    .desktop-nav {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .desktop-nav-link {
        font-size: 13px;
        font-weight: 500;
        padding: 6px 12px;
        border-radius: 6px;
        transition: all 0.2s;
        white-space: nowrap;
    }

    /* User balance header - compact */
    .user-balance-header {
        padding: 6px 10px;
        font-size: 12px;
        flex-shrink: 0;
    }

    /* Desktop Auth Buttons - compact */
    .desktop-auth {
        display: flex;
        gap: 8px;
        align-items: center;
        flex-shrink: 0;
    }

    .btn-login-desktop,
    .btn-register-desktop {
        padding: 8px 16px;
        border-radius: 8px;
        font-weight: 600;
        font-size: 13px;
        transition: all 0.2s;
        position: relative;
        overflow: hidden;
        white-space: nowrap;
        border: none;
        cursor: pointer;
        font-family: inherit;
    }

    /* Desktop User Actions - compact */
    .desktop-user-actions {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
    }

    .btn-action-desktop {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Hide mobile elements on desktop */
    .bottom-nav {
        display: none !important;
    }

    .menu-btn {
        display: none !important;
    }

    .fast-deposit-btn {
        display: none !important;
    }

    .mobile-only {
        display: none !important;
    }

    /* Game Cards Desktop Grid */
    .games-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 16px;
    }

    .category-icons {
        justify-content: center;
        gap: 24px;
    }

    .provider-scroll {
        justify-content: center;
    }
}

/* Extra Large Desktop - more space for elements */
@media (min-width: 1280px) {
    .container {
        max-width: 1200px;
    }

    .header-top {
        gap: 20px;
    }

    .announcement-ticker {
        flex: 0 1 400px;
    }

    .desktop-nav {
        gap: 12px;
    }

    .desktop-nav-link {
        padding: 8px 16px;
        font-size: 14px;
    }

    .btn-login-desktop,
    .btn-register-desktop {
        padding: 10px 20px;
        font-size: 14px;
    }

    .btn-action-desktop {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ==========================================
   SCROLLBAR STYLES
   ========================================== */
* {
    scrollbar-width: thin;
}
