/* public/css/custom.css - MOBILE-FIRST INTERACTIVE VERSION */


/* --- MOBILE-FIRST BASE STYLES (320px+) --- */
/* Design for mobile first, then scale up */

/* General Body & Theme */
body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    /* Disable pull-to-refresh */
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

html {
    /* Prevent pull-to-refresh on root element */
    overscroll-behavior-y: contain;
}

/* Main Container - Mobile First */
.main-container {
    width: 100%;
    padding: 0.75rem;
    margin: 0 auto;
    animation: fadeInUp 0.6s ease-out;
}

/* Container Wrapper for Better Spacing */
.container {
    padding-left: 15px;
    padding-right: 15px;
}

/* --- INTERACTIVE CARD STYLES (Mobile First) --- */
.card-custom {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.25rem;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

/* Interactive Tap Effect */
.card-custom:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-custom:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Card Shimmer Effect */
.card-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.card-custom:hover::before {
    left: 100%;
}

/* Welcome Header - Mobile */
.welcome-header {
    text-align: center;
    margin-bottom: 1.25rem;
    padding: 1rem 0.5rem;
}

.welcome-header h1 {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.welcome-header .lead {
    font-size: 0.95rem;
    color: #6c757d;
}

/* --- TOUCH-FRIENDLY TOKEN BALANCE (Mobile First) --- */
.token-balance-display {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #333;
    padding: 1.25rem;
    border-radius: 20px;
    margin-bottom: 1.25rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.token-balance-display:active {
    transform: scale(0.97);
}

/* Animated Background */
.token-balance-display::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    animation: rotate 6s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.token-balance-display h5 {
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

.token-balance-display .display-4 {
    font-size: 2rem;
    position: relative;
    z-index: 1;
}

.token-balance-display small {
    opacity: 0.85;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* --- BETTING FORM (Mobile Optimized) --- */
.betting-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 2px solid #e9ecef;
}

.betting-card .form-control,
.betting-card .form-select {
    border-radius: 12px;
    border: 2px solid #e9ecef;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

/* Touch Feedback */
.betting-card .form-control:focus,
.betting-card .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15);
    transform: scale(1.02);
}

/* Large Input for Numbers - Touch Friendly */
.betting-card .form-control-lg {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 700;
    color: #0d6efd;
    padding: 1rem;
    letter-spacing: 0.1em;
}

/* --- TOUCH-OPTIMIZED BUTTONS (Mobile First) --- */
.btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px; /* Touch target size */
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.96);
}

/* Primary Gradient Button */
.btn-primary-gradient {
    font-weight: 700;
    font-size: 1.15rem;
    padding: 1rem 1.75rem;
    border: none;
    border-radius: 14px;
    color: white;
    background: linear-gradient(135deg, #0d6efd, #3c8cff);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-primary-gradient::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    bottom: -50%;
    left: -50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    transition: all 0.3s;
}

.btn-primary-gradient:hover::after {
    top: -100%;
    right: -100%;
    bottom: -100%;
    left: -100%;
}

.btn-primary-gradient:active {
    transform: scale(0.95);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
}

/* --- COUNTDOWN TIMER (Mobile Interactive) --- */
.countdown-timer {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 1.25rem;
    border-radius: 16px;
    margin-bottom: 1.25rem;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.35);
    border: 3px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.countdown-timer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: slide 3s infinite;
}

@keyframes slide {
    to { left: 100%; }
}

#countdown-display {
    font-family: 'Courier New', monospace;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    margin-top: 0.75rem;
    font-size: 2rem;
    letter-spacing: 0.15em;
}

.countdown-timer.warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    animation: pulse-warning 1.5s infinite;
}

.countdown-timer.critical {
    background: linear-gradient(135deg, #dc3545, #c82333);
    animation: pulse-critical 0.8s infinite;
}

@keyframes pulse-warning {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(255, 193, 7, 0.35); }
    50% { transform: scale(1.03); box-shadow: 0 6px 25px rgba(255, 193, 7, 0.5); }
}

@keyframes pulse-critical {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(220, 53, 69, 0.35); }
    50% { transform: scale(1.05); box-shadow: 0 8px 30px rgba(220, 53, 69, 0.6); }
}

/* --- QUICK BETTING FEATURES (Touch Optimized) --- */
.feature-section {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    padding: 1.25rem;
    border-radius: 16px;
    margin-bottom: 1.25rem;
    border: 2px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.feature-section:active {
    transform: scale(0.98);
}

.feature-section h6 {
    color: #495057;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #dee2e6;
}

/* Favorite & Hot Numbers - Touch Friendly */
.favorite-number,
.hot-number {
    border: none;
    margin: 0.25rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.favorite-number {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.favorite-number:active {
    transform: scale(0.9) rotate(-5deg);
}

.favorite-number.selected {
    background: linear-gradient(135deg, #28a745, #20c997);
    transform: scale(1.1);
    animation: bounce 0.5s;
}

.hot-number {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.hot-number::before {
    content: "🔥";
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 14px;
    animation: flame 1s infinite;
}

@keyframes flame {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.hot-number:active {
    transform: scale(0.9) rotate(5deg);
}

/* Quick Amount Buttons */
.quick-amount-btn {
    margin: 0.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 24px;
    padding: 0.75rem 1.25rem;
    border: 2px solid #0d6efd;
    background: white;
    color: #0d6efd;
    min-width: 70px;
    font-size: 0.95rem;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}

.quick-amount-btn:active {
    transform: scale(0.92);
}

.quick-amount-btn.selected {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
}

/* Repeat Last Bet Button */
.repeat-last-bet {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 1rem 1.5rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.35);
    width: 100%;
    min-height: 56px;
}

.repeat-last-bet:active {
    transform: scale(0.97);
}

/* --- LUCKY NUMBER DISPLAY (Interactive) --- */
.lucky-number-display,
.lucky-number-banner {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #333;
    padding: 1.25rem;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 1.25rem;
    font-weight: 700;
    font-size: 0.95rem;
    border: 3px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    animation: lucky-glow 3s infinite;
    position: relative;
    overflow: hidden;
}

.lucky-number-display i,
.lucky-number-banner i {
    animation: twinkle 1.5s infinite;
}

@keyframes lucky-glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 6px 30px rgba(255, 215, 0, 0.6);
        transform: scale(1.02);
    }
}

@keyframes twinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* --- HOT NUMBERS STRIP --- */
.hot-numbers-strip {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 1.25rem;
    border-radius: 16px;
    margin-bottom: 1.25rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.35);
    border: 3px solid rgba(255, 255, 255, 0.15);
}

.hot-number-badge {
    background: rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin: 0.25rem;
    font-weight: 700;
    display: inline-block;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.hot-number-badge:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.4);
}

/* --- STATS DISPLAY (Mobile Optimized) --- */
.stats-quick-view,
.stats-mini {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    margin: 0.25rem;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stats-mini:active {
    transform: scale(0.96);
    background: #f8f9fa;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- MY BETS DISPLAY --- */
.my-bets-on-card {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: 14px;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    border: 2px solid #90caf9;
    box-shadow: 0 3px 12px rgba(144, 202, 249, 0.3);
}

.my-bets-card {
    border-left: 5px solid #28a745;
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.08), transparent);
}

.my-bet-badge {
    font-size: 1.2rem;
    padding: 0.5rem 0.875rem;
    border-radius: 10px;
}

/* --- ANIMATIONS --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* --- FAVORITE STAR --- */
.favorite-star {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #dee2e6;
    cursor: pointer;
    font-size: 1.4rem;
    transition: all 0.3s ease;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
}

.favorite-star:active {
    transform: scale(1.5) rotate(72deg);
}

.favorite-star.active {
    color: #ffc107;
    text-shadow: 0 0 15px rgba(255, 193, 7, 0.8);
    animation: star-pulse 1.5s infinite;
}

@keyframes star-pulse {
    0%, 100% { transform: scale(1.2); }
    50% { transform: scale(1.4); }
}

/* --- ALERT STYLES --- */
.alert {
    border-radius: 14px;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-weight: 500;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

/* --- NAVBAR MOBILE --- */
.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    transition: all 0.3s ease;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 0.75rem 1rem !important;
    margin: 0.25rem;
}

.nav-link:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
}

/* --- FORM ELEMENTS --- */
.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* --- PULL TO REFRESH INDICATOR --- */
/* Disabled - Pull to refresh removed
.pull-to-refresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d6efd, #3c8cff);
    color: white;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.pull-to-refresh.active {
    transform: translateY(0);
}
*/

/* --- LOADING SPINNER --- */
.spinner-border {
    border-width: 3px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- TABLET BREAKPOINT (576px+) --- */
@media (min-width: 576px) {
    .main-container {
        padding: 1rem;
    }

    .welcome-header h1 {
        font-size: 2rem;
    }

    .token-balance-display,
    .countdown-timer {
        padding: 1.5rem;
    }

    #countdown-display {
        font-size: 2.25rem;
    }

    .favorite-number,
    .hot-number {
        width: 56px;
        height: 56px;
        font-size: 1.15rem;
    }

    .quick-amount-btn {
        min-width: 85px;
        padding: 0.875rem 1.5rem;
    }

    .stat-number {
        font-size: 1.65rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }
}

/* --- DESKTOP BREAKPOINT (768px+) --- */
@media (min-width: 768px) {
    .main-container {
        max-width: 720px;
        padding: 1.5rem;
        margin: 2rem auto;
    }

    .welcome-header h1 {
        font-size: 2.5rem;
    }

    .welcome-header .lead {
        font-size: 1.1rem;
    }

    .token-balance-display {
        padding: 1.75rem;
    }

    .token-balance-display .display-4 {
        font-size: 2.5rem;
    }

    #countdown-display {
        font-size: 2.5rem;
    }

    .countdown-timer {
        font-size: 1.25rem;
        padding: 1.75rem;
    }

    .feature-section {
        padding: 1.75rem;
    }

    .favorite-number,
    .hot-number {
        width: 60px;
        height: 60px;
        font-size: 1.2rem;
    }

    .quick-amount-btn {
        min-width: 95px;
        font-size: 1rem;
    }

    .repeat-last-bet {
        font-size: 1.05rem;
    }

    .stats-mini {
        min-height: 85px;
        padding: 1.25rem;
    }

    .stat-number {
        font-size: 1.85rem;
    }

    .stat-label {
        font-size: 0.9rem;
    }

    /* Hover effects enabled on desktop */
    .card-custom:hover {
        transform: translateY(-6px);
    }

    .favorite-number:hover,
    .hot-number:hover {
        transform: scale(1.15) rotate(5deg);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    }

    .quick-amount-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 18px rgba(13, 110, 253, 0.35);
    }
}

/* --- LARGE DESKTOP (992px+) --- */
@media (min-width: 992px) {
    .main-container {
        max-width: 900px;
    }
}

/* --- ACCESSIBILITY --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- HIGH CONTRAST MODE --- */
@media (prefers-contrast: high) {
    .btn-primary-gradient {
        background: #0000ff !important;
        border: 3px solid #ffffff !important;
    }

    .card-custom {
        border: 2px solid #000000 !important;
    }
}

/* --- DARK MODE SUPPORT --- */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        color: #e4e4e4;
    }

    .card-custom {
        background: #2d3142;
        color: #e4e4e4;
    }

    .welcome-header h1 {
        color: #ffffff;
    }

    .feature-section {
        background: #2d3142;
        border-color: #3f4254;
    }
}
