/* 
   ==============================================
   ?? LOTTERY THEME - PREMIUM UI STYLES
   ==============================================
   Modern, animated lottery game interface
   Features: 3D balls, glassmorphism, gradients
   ==============================================
*/

/* ============================================== */
/* ROOT VARIABLES & THEME COLORS                 */
/* ============================================== */

:root {
    /* Primary Palette - Deep Purples & Golds */
    --lottery-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --lottery-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --lottery-accent: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    --lottery-gold: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    --lottery-bonus: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    
    /* Background Gradients */
    --bg-gradient-primary: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    --bg-gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    
    /* Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.5);
    
    /* Ball Colors */
    --ball-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --ball-bonus: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    --ball-special: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

/* ============================================== */
/* PAGE BACKGROUND & LAYOUT                      */
/* ============================================== */

.lottery-page {
    min-height: 100vh;
    background: var(--bg-gradient-primary);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

.lottery-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(245, 87, 108, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.lottery-container {
    position: relative;
    z-index: 1;
    padding: var(--spacing-lg);
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================== */
/* LOTTERY BALL COMPONENT STYLES                 */
/* ============================================== */

.lottery-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0.25rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Ball Sizes */
.lottery-ball-small {
    width: 40px;
    height: 40px;
}

.lottery-ball-medium {
    width: 56px;
    height: 56px;
}

.lottery-ball-large {
    width: 72px;
    height: 72px;
}

/* Ball Inner Container - Creates 3D sphere effect */
.ball-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

/* Ball Types - Different gradient colors */
.lottery-ball-primary .ball-inner {
    background: var(--ball-primary);
}

.lottery-ball-bonus .ball-inner {
    background: var(--ball-bonus);
}

.lottery-ball-special .ball-inner {
    background: var(--ball-special);
}

/* Glossy shine effect on top of ball */
.ball-shine {
    position: absolute;
    top: 15%;
    left: 20%;
    width: 40%;
    height: 30%;
    background: radial-gradient(
        ellipse at top left,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.3) 40%,
        transparent 70%
    );
    border-radius: 50%;
    pointer-events: none;
}

/* Number displayed on ball */
.ball-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.lottery-ball-small .ball-number {
    font-size: 1.1rem;
}

.lottery-ball-large .ball-number {
    font-size: 2rem;
}

/* Hover Effects */
.lottery-ball:hover {
    transform: translateY(-4px) scale(1.05);
    cursor: pointer;
}

.lottery-ball:hover .ball-inner {
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        0 0 30px rgba(102, 126, 234, 0.6);
}

/* Entrance Animation */
.lottery-ball-animated {
    animation: ballEntrance 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes ballEntrance {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* ============================================== */
/* NUMBER SET COMPONENT                          */
/* ============================================== */

.number-set {
    margin: var(--spacing-md) 0;
}

.number-set-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-sm);
}

.number-set-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.main-numbers,
.bonus-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.bonus-separator {
    margin: 0 var(--spacing-sm);
    padding: 0 var(--spacing-sm);
    border-left: 2px solid rgba(255, 255, 255, 0.2);
    border-right: 2px solid rgba(255, 255, 255, 0.2);
}

.separator-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

/* ============================================== */
/* GLASS CARD COMPONENTS                         */
/* ============================================== */

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
}

.glass-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(255, 255, 255, 0.2);
}

.glass-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.glass-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.glass-card-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.glass-card-body {
    color: var(--text-secondary);
}

/* ============================================== */
/* SUGGESTION CARD - Special styling for results */
/* ============================================== */

.suggestion-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: slideInUp 0.5s ease backwards;
}

.suggestion-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    border-color: rgba(102, 126, 234, 0.4);
}

.suggestion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.suggestion-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--lottery-primary);
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.suggestion-score {
    flex: 1;
    max-width: 200px;
}

.score-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.score-bar {
    height: 32px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.score-fill {
    height: 100%;
    background: var(--lottery-gold);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(246, 211, 101, 0.4);
}

.suggestion-explanation {
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border-left: 3px solid rgba(102, 126, 234, 0.5);
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================== */
/* FORM ELEMENTS - Premium styling              */
/* ============================================== */

.form-group-modern {
    margin-bottom: var(--spacing-md);
}

.form-label-modern {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-select-modern,
.form-input-modern {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-select-modern:focus,
.form-input-modern:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-select-modern option {
    background: #1e293b;
    color: var(--text-primary);
}

/* ============================================== */
/* BUTTONS - Animated gradient buttons          */
/* ============================================== */

.btn-lottery-primary {
    position: relative;
    padding: 1rem 2rem;
    background: var(--lottery-primary);
    border: none;
    border-radius: 16px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-lottery-primary::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 ease;
}

.btn-lottery-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-lottery-primary:hover::before {
    left: 100%;
}

.btn-lottery-primary:active {
    transform: translateY(0);
}

.btn-lottery-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Spinner for loading state */
.spinner-modern {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================== */
/* ALERT MESSAGES                                */
/* ============================================== */

.alert-modern {
    padding: var(--spacing-md);
    border-radius: 12px;
    margin-top: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    animation: slideInDown 0.3s ease;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.alert-icon {
    font-size: 1.5rem;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================== */
/* PAGE HEADER                                   */
/* ============================================== */

.page-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg) 0;
}

.page-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    text-shadow: 0 0 40px rgba(102, 126, 234, 0.3);
    animation: titleGlow 3s ease-in-out infinite;
}

.page-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 400;
}

@keyframes titleGlow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(246, 211, 101, 0.5));
    }
}

/* ============================================== */
/* RESPONSIVE DESIGN                             */
/* ============================================== */

@media (max-width: 768px) {
    .lottery-container {
        padding: var(--spacing-sm);
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .glass-card {
        padding: var(--spacing-md);
    }
    
    .lottery-ball-medium {
        width: 48px;
        height: 48px;
    }
    
    .ball-number {
        font-size: 1.25rem;
    }
    
    .suggestion-header {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .suggestion-score {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .lottery-ball-medium {
        width: 40px;
        height: 40px;
    }
    
    .ball-number {
        font-size: 1.1rem;
    }
    
    .btn-lottery-primary {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
}

/* ============================================== */
/* UTILITY CLASSES                               */
/* ============================================== */

.shimmer {
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(102, 126, 234, 0.6);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
