/* Modern Lottery Pool Manager - Redis-Only Design */

:root {
    --primary: #3b82f6;
    --primary-dark: #1e3a8a;
    --secondary: #10a37f;
    --success: #16a34a;
    --warning: #eab308;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
    --sidebar-width: 280px;
    --header-height: 60px;
    --filter-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    position: relative;
    width: 100%;
}

/* App Layout */
.app-layout {
    display: grid;
    grid-template-areas:
        "header header"
        "sidebar filters"
        "sidebar content";
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--header-height) var(--filter-height) calc(100vh - var(--header-height) - var(--filter-height));
    height: 100vh;
    overflow: hidden;
}

/* Header */
.app-header {
    grid-area: header;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 100;
}

.app-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none; /* Hidden by default on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin: 0;
    width: 44px;
    height: 44px;
    position: relative;
    z-index: 1000;
    transition: transform 0.2s ease;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* Hamburger Icon (3 lines) */
.hamburger-icon {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    position: relative;
    transition: background 0.3s ease;
}

.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    position: absolute;
    left: 0;
    transition: transform 0.3s ease;
}

.hamburger-icon::before {
    top: -8px;
}

.hamburger-icon::after {
    top: 8px;
}

/* Animate to X when menu is open */
.sidebar.mobile-active ~ * .mobile-menu-toggle .hamburger-icon {
    background: transparent;
}

.sidebar.mobile-active ~ * .mobile-menu-toggle .hamburger-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.sidebar.mobile-active ~ * .mobile-menu-toggle .hamburger-icon::after {
    transform: rotate(-45deg);
    top: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.account-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 20px;
    font-size: 14px;
}

.balance-label {
    color: #0369a1;
    font-weight: 600;
}

.balance-amount {
    color: #0c4a6e;
    font-weight: 800;
    font-size: 16px;
}

.user-badge {
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    font-size: 14px;
}

/* Sign In / Sign Out buttons */
.sign-in-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.sign-in-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.user-logged-in {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-logged-in .user-badge-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #10b981;
    border-radius: 20px;
    text-decoration: none;
    color: #065f46;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.user-logged-in .user-badge-link:hover {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.user-logged-in .status-icon {
    font-size: 16px;
}

/* Lottery Pool Auth Toggle */
.ga-auth-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ga-auth-toggle:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    color: white;
    transform: translateY(-1px);
}

.ga-auth-toggle.connected {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #10b981;
    color: #065f46;
}

.ga-auth-toggle.connected:hover {
    background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
}

.ga-auth-toggle.connecting {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    color: #92400e;
    cursor: wait;
    animation: pulse 1.5s ease-in-out infinite;
}

.ga-auth-toggle.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #ef4444;
    color: #991b1b;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

#gaAuthIcon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.ga-auth-toggle.connecting #gaAuthIcon {
    animation: spin 2s linear infinite;
}

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

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    text-decoration: none;
    color: white;
    font-size: 18px;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

/* Filter Bar (Game-Specific) */
.filter-bar {
    grid-area: filters;
    background: white;
    border-bottom: 2px solid var(--gray-200);
    border-left: 2px solid var(--gray-200);
    padding: 0 20px;
    display: flex;
    align-items: center;
}

.filter-content {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    overflow-x: auto;
}

.filter-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--gray-50);
    border-radius: 8px;
    margin-left: auto;
}

.info-label {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 13px;
}

.info-value {
    font-weight: 700;
    color: var(--primary);
    font-size: 18px;
}

.info-value.loading {
    color: var(--gray-400);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.custom-date-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.custom-date-picker .date-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-date-picker .date-input-group label {
    white-space: nowrap;
    font-weight: 600;
    color: var(--gray-600);
    font-size: 14px;
}

.custom-date-picker .date-input {
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
}

.custom-date-picker .btn-sm {
    padding: 6px 16px;
    font-size: 13px;
    margin-left: 10px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
}

.filter-select, .filter-input {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s;
}

.filter-select:focus, .filter-input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-group {
    flex: 1;
    max-width: 300px;
}

.filter-input {
    width: 100%;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--gray-200);
    transform: translateY(-2px);
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background: white;
    border-right: 2px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 2px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 18px;
    color: var(--gray-800);
}

.game-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Game Card */
.game-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: var(--gray-50);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.game-card:hover {
    background: var(--gray-100);
    transform: translateX(5px);
}

.game-card.selected {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #1d4ed8;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    transform: translateX(4px);
}

.game-card.selected .game-name {
    color: white;
    font-weight: 600;
}

.game-card.selected .game-jackpot {
    color: #fef3c7;
    font-weight: 600;
}

.game-card.selected .game-next-draw {
    color: #dbeafe;
}

.game-card.selected .game-icon {
    transform: scale(1.1);
}

.game-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
}

.game-info {
    flex: 1;
}

.game-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.game-jackpot {
    font-size: 18px;
    font-weight: 800;
    color: var(--success);
    margin-bottom: 2px;
}

.game-next-draw {
    font-size: 12px;
    color: var(--gray-600);
}

/* Removed game-check - using card highlighting instead */

/* Sidebar Footer */
.sidebar-footer {
    padding: 15px;
    border-top: 2px solid var(--gray-200);
    background: var(--gray-50);
}

.cache-indicator {
    text-align: center;
}

.cache-indicator span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.cache-indicator small {
    font-size: 12px;
    color: var(--gray-600);
}

/* Main Content */
.main-content {
    grid-area: content;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--gray-50);
    transition: margin-left 0.3s ease;
    width: 100%;
    position: relative;
}

.content-inner {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - var(--header-height) - var(--filter-height));
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .content-inner {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .content-inner {
        padding: 15px;
    }
    
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }
}

/* Page Headers */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.page-header p {
    font-size: 16px;
    color: var(--gray-600);
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 24px;
    clear: both; /* Prevent float overlaps */
}

.card h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--gray-800);
    font-weight: 700;
}

.card:last-child {
    margin-bottom: 40px; /* Extra spacing at bottom */
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-800);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* Mobile Menu Backdrop */
.mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.mobile-menu-backdrop.active {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    /* Ensure everything fits within viewport */
    * {
        max-width: 100%;
    }
    
    /* Prevent layout overflow */
    .app-layout {
        width: 100vw;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Show mobile menu button */
    .mobile-menu-toggle {
    display: flex;
    align-items: center;
        justify-content: center;
    }
    
    /* Smaller title on mobile */
    .app-title {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }
    
    /* Header responsive layout */
    .app-header {
        padding: 0 12px;
    }
    
    .header-left {
        flex: 1;
        min-width: 0; /* Allow flex children to shrink */
        gap: 12px;
    }
    
    .header-right {
        flex-shrink: 0; /* Don't shrink auth buttons */
        gap: 8px;
    }
    
    /* Show backdrop on mobile */
    .mobile-menu-backdrop {
        display: block;
        pointer-events: none;
    }
    
    .mobile-menu-backdrop.active {
        pointer-events: auto;
    }
    
    /* Adjust layout for mobile */
    .app-layout {
        grid-template-areas:
            "header"
            "filters"
            "content";
        grid-template-columns: 1fr;
        grid-template-rows: var(--header-height) auto 1fr; /* Change filter-height to auto */
    }
    
    /* Mobile sidebar (slide-out) */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--sidebar-width);
        z-index: 99;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        padding-top: var(--header-height);
    }
    
    .sidebar.mobile-active {
        transform: translateX(0);
    }
    
    /* Adjust header spacing */
    .app-header {
        padding: 0 15px;
    }
    
    .header-right {
        gap: 10px;
    }
    
    /* Hide account balance text on very small screens */
    .account-balance {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .balance-label {
        display: none;
    }
    
    /* Smaller user badge */
    .user-badge-link {
        padding: 6px 10px;
        font-size: 12px;
        max-width: 150px;
    }
    
    .user-email {
        max-width: 80px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .status-icon {
        flex-shrink: 0;
    }
    
    /* Filter bar adjustments - STACK VERTICALLY */
    .filter-bar {
        padding: 10px !important;
        gap: 0 !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        display: block !important; /* Force block layout */
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }
    
    .filter-content {
        display: flex !important;
        flex-direction: column !important; /* Stack vertically */
        align-items: stretch !important;
        gap: 10px !important;
        width: 100% !important;
    }
    
    .filter-group {
        flex-shrink: 0;
        width: 100% !important;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    
    .filter-group label {
    width: 100%;
    }
    
    .filter-select {
        width: 100% !important; /* Full width */
    }
    
    /* Custom date picker on mobile - compact horizontal layout */
    .custom-date-picker {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }
    
    .custom-date-picker .date-input-group {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .custom-date-picker .date-input-group label {
        font-size: 11px;
    font-weight: 600;
    }
    
    .custom-date-picker .date-input {
        width: 100%;
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .custom-date-picker .btn-sm {
        grid-column: 1 / -1; /* Span both columns */
        width: 100%;
        margin-left: 0;
        margin-top: 4px;
    }
    
    /* Hide divider on mobile */
    .filter-divider {
        display: none !important;
    }
    
    .filter-info {
        display: flex !important; /* Force display */
        padding: 10px 12px !important;
        font-size: 13px !important;
        width: 100% !important; /* Full width */
        margin-left: 0 !important; /* Remove auto margin */
        margin-top: 0 !important; /* Remove extra top margin */
        box-sizing: border-box !important;
        justify-content: center !important; /* Center content */
        visibility: visible !important; /* Force visibility */
        opacity: 1 !important;
        background: var(--gray-100) !important; /* Slightly more visible background */
        order: 999 !important; /* Force to bottom */
    }
    
    .info-label {
        font-size: 13px;
    font-weight: 600;
}

    .info-value {
        font-size: 18px;
        font-weight: 700;
    }
    
    /* Content padding */
    .content-inner {
        padding: 15px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    /* Smaller cards */
    .card {
        padding: 16px;
        margin-bottom: 16px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Ensure grids don't overflow */
    .ai-controls,
    .chat-controls,
    .stats-grid,
    .action-buttons,
    .game-list {
        width: 100%;
        max-width: 100%;
    }
    
    /* Make sure images/videos don't overflow */
    img, video, svg {
        max-width: 100%;
        height: auto;
    }
    
    /* Prevent tables from causing overflow */
    table {
        width: 100%;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Ensure form elements fit */
    input, textarea, select, button {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix any pre/code blocks */
    pre, code {
        max-width: 100%;
        overflow-x: auto;
        word-wrap: break-word;
    }
    
    /* Fix drawing cards grid on tablet */
    .recent-drawings-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .drawing-card {
        min-width: 0; /* Allow shrinking */
    }
    
    .drawing-numbers {
    flex-wrap: wrap;
    justify-content: center;
    }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
    /* Stricter width control */
    body, html {
        width: 100vw;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .app-title {
        font-size: 14px;
        max-width: 150px;
    }
    
    .sidebar {
        width: 85vw; /* Take most of screen on very small devices */
        max-width: 280px;
    }
    
    .app-header {
        padding: 0 10px;
    }
    
    .header-right {
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .content-inner {
        padding: 12px;
        width: 100%;
    }
    
    .card {
        padding: 12px;
        border-radius: 8px;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    .card h2 {
        font-size: 16px;
        word-wrap: break-word;
    }
    
    /* Stack buttons vertically on very small screens */
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    /* Make number balls smaller if needed */
    .number-ball {
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }
    
    /* Ensure AI controls wrap properly */
    .ai-controls,
    .chat-controls {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* Smaller touch targets acceptable on very small screens */
    .btn {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    /* Ensure search inputs don't overflow */
    .search-group {
        max-width: 100%;
    width: 100%;
    }
    
    /* Pool detail page stacking */
    .pool-layout {
        grid-template-columns: 1fr !important; /* Single column */
        gap: 1rem !important;
    }
    
    .pool-sidebar {
    display: flex;
        flex-direction: column;
    }
    
    /* Fix drawing cards on very small screens */
    .recent-drawings-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .drawing-card {
        padding: 0.75rem;
    }
    
    .drawing-numbers {
        gap: 0.35rem;
    }
    
    .draw-num {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
    }
    
    /* Filter bar already stacked from 768px breakpoint */
    .filter-bar {
        padding: 8px !important;
        height: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
    
    .filter-content {
        gap: 8px !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .filter-info {
        display: flex !important;
        padding: 8px 10px !important;
        font-size: 12px !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
    }
    
    .info-label {
        font-size: 12px;
    font-weight: 600;
}

    .info-value {
        font-size: 16px;
        font-weight: 700;
    }
    
    .custom-date-picker .date-input-group label {
        font-size: 13px;
    }
    
    .custom-date-picker .date-input {
        font-size: 13px;
        padding: 5px 8px;
    }
    
    .filter-select {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .filter-group label {
        font-size: 12px;
    }
    
    /* Compact header on very small screens */
    .app-header {
        padding: 0 8px;
    }
    
    .header-left {
        gap: 8px;
        flex: 1;
        min-width: 0;
    }
    
    .header-right {
        gap: 6px;
        flex-shrink: 0;
    }
    
    /* Prevent text overflow in header */
    .sign-in-btn {
        font-size: 13px;
        padding: 6px 12px;
        white-space: nowrap;
    }
    
    /* Account balance compact */
    .account-balance {
        padding: 4px 8px;
        font-size: 11px;
        flex-shrink: 0;
    }
    
    .balance-amount {
        font-size: 13px !important;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }


/* ============================================
   AI Number Picker Styles
   ============================================ */

.ai-controls,
.chat-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: end;
}

.ai-controls .form-group,
.chat-controls .form-group {
    display: flex;
    flex-direction: column;
}

.ai-controls .form-group label,
.chat-controls .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
    font-size: 0.875rem;
}

.ai-controls .filter-select,
.ai-controls .form-control,
.chat-controls .filter-select,
.chat-controls .form-control {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9375rem;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ai-controls .filter-select:focus,
.ai-controls .form-control:focus,
.chat-controls .filter-select:focus,
.chat-controls .form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Chat Input Responsive */
.chat-input-container {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .ai-controls,
    .chat-controls {
        grid-template-columns: 1fr;
    }
    
    .chat-input-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .chat-input-container textarea {
        width: 100%;
    }
    
    .chat-input-container .chat-send-btn {
        width: 100%;
        height: auto !important;
        padding: 0.75rem 1.5rem !important;
        justify-content: center;
    }
}

.ai-reasoning {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid #38bdf8;
}

.ai-reasoning h3 {
    margin-top: 0;
    color: #0284c7;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reasoning-box {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    color: #1e293b;
    line-height: 1.6;
}

.insights-list {
    margin: 1rem 0;
}

.insights-list div {
    padding: 0.5rem 0;
    color: #1e293b;
}

.confidence-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-sets-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-sets-container .number-set {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.ai-sets-container .number-set:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.ai-sets-container .set-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.ai-sets-container .set-label {
    font-weight: 600;
    color: #3b82f6;
    font-size: 1.1rem;
}

.ai-sets-container .number-display {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.ai-sets-container .primary-numbers {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ai-sets-container .number-ball {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    transition: transform 0.2s ease;
}

.ai-sets-container .number-ball:hover {
    transform: scale(1.1);
}

.ai-sets-container .number-ball.secondary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Recent Drawings Grid */
.recent-drawings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.drawing-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s ease;
}

.drawing-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.drawing-date {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.drawing-numbers {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.draw-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.draw-num.secondary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.drawing-jackpot {
    font-size: 0.8rem;
    color: #059669;
    font-weight: 600;
    margin-top: 0.5rem;
}
