/* ============================================
   Mobile App Responsive Styles
   Bybit-inspired Lottery Application
   ============================================ */

/* CSS Variables for Consistent Theming */
:root {
    --primary-color: #00d4ff;
    --secondary-color: #f0b90b;
    --bg-dark: #0b0e11;
    --bg-card: #1e2229;
    --bg-card-hover: #252a33;
    --border-color: #2a2e35;
    --text-primary: #ffffff;
    --text-secondary: #b8bcc3;
    --text-muted: #6b7280;
    --success: #00dc8c;
    --danger: #f6465d;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

/* ============================================
   About Section Styles
   ============================================ */
.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--bg-dark) 100%);
    color: var(--text-primary);
    font-weight: 600;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

.card-body {
    padding: 16px;
}

.card-body h5 {
    color: var(--primary-color);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

.card-body p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 12px;
}

.card-body ul {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.8;
    padding-left: 18px;
    margin-bottom: 12px;
}

.card-body li {
    margin-bottom: 6px;
}

.card-body .tier-badge {
    background: var(--bg-card-hover);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-primary);
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 8px;
}

/* ============================================
   Base Mobile Styles (320px+)
   ============================================ */
* {
    box-sizing: border-box;
}

html {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: "DM Sans", "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================================
   Container & Layout
   ============================================ */
#root {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: linear-gradient(145deg, var(--bg-card) 0%, #16191f 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.cardPopcorn {
    min-height: 200px;
    border-radius: var(--radius-md);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    min-height: 40px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #00a3cc 100%);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #00e5ff 0%, #00b8e6 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #d4a209 100%);
    color: var(--bg-dark);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #ffc107 0%, #e6a800 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(240, 185, 11, 0.3);
}

.btn:active {
    transform: scale(0.98);
}

.btnd {
    margin: 4px 0;
    width: 100%;
    display: block;
}

/* ============================================
   Form Controls
   ============================================ */
.form-control {
    width: 100%;
    padding: 12px 14px;
    background: #1a1d24;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.form-control::placeholder {
    color: var(--text-muted);
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea.form-control {
    background: #1a1d24;
    color: var(--text-primary);
}

/* ============================================
   Tables
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

td {
    color: var(--text-secondary);
}

tr:hover {
    background: rgba(0, 212, 255, 0.05);
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
    margin: 0 0 10px 0;
    color: var(--text-secondary);
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(30, 34, 41, 0.95);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    gap: 16px;
}

.navbar-item {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.navbar-item:hover,
.navbar-item.active {
    color: var(--primary-color);
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   Media Queries
   ============================================ */

/* Small Mobile (320px - 374px) */
@media screen and (max-width: 374px) {
    html { font-size: 12px; }
    
    .container { padding: 0 8px; }
    
    .card { padding: 12px; margin-bottom: 8px; }
    
    .btn { padding: 8px 16px; min-height: 36px; font-size: 12px; }
    
    table { font-size: 11px; }
    
    th, td { padding: 8px 6px; }
}

/* Large Mobile (375px - 424px) */
@media screen and (min-width: 375px) and (max-width: 424px) {
    html { font-size: 13px; }
    
    .container { padding: 0 12px; }
    
    .card { padding: 14px; }
    
    .btn { padding: 10px 18px; }
}

/* Phablet (425px - 767px) */
@media screen and (min-width: 425px) and (max-width: 767px) {
    html { font-size: 14px; }
    
    .container { padding: 0 16px; }
    
    .card { padding: 16px; }
    
    .btn { padding: 12px 24px; }
}

/* Tablet Portrait (768px - 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    html { font-size: 15px; }
    
    .container { padding: 0 20px; }
    
    .card { 
        padding: 20px; 
        margin-bottom: 16px;
    }
    
    .cardPopcorn { min-height: 280px; }
    
    .btn { padding: 12px 28px; }
    
    .btnd {
        width: auto;
        display: inline-block;
        margin-left: 8px;
    }
    
    .navbar-menu { gap: 24px; }
    
    table { font-size: 14px; }
    
    th, td { padding: 12px 16px; }
}

/* Tablet Landscape / Small Desktop (1024px - 1279px) */
@media screen and (min-width: 1024px) and (max-width: 1279px) {
    html { font-size: 15px; }
    
    .container { padding: 0 24px; }
    
    .card { 
        padding: 24px; 
        margin-bottom: 20px;
    }
    
    .cardPopcorn { min-height: 300px; }
    
    .btn { padding: 14px 32px; }
    
    .btnd {
        width: auto;
        display: inline-block;
        margin-left: 12px;
    }
}

/* Desktop (1280px+) */
@media screen and (min-width: 1280px) {
    html { font-size: 16px; }
    
    .container { padding: 0 32px; }
    
    .card { 
        padding: 28px; 
        margin-bottom: 24px;
    }
    
    .cardPopcorn { min-height: 320px; }
    
    .btn { padding: 14px 36px; }
    
    .btnd {
        width: auto;
        display: inline-block;
        margin-left: 16px;
    }
    
    .navbar {
        padding: 16px 32px;
    }
}

/* ============================================
   Safe Area Insets (iOS)
   ============================================ */
@supports (padding: max(0px)) {
    body {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
    
    .navbar {
        padding-top: max(12px, env(safe-area-inset-top));
        padding-bottom: max(12px, env(safe-area-inset-top));
    }
}

/* ============================================
   Touch Optimizations
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 48px;
        padding: 14px 24px;
    }
    
    .form-control {
        padding: 14px 16px;
    }
    
    a, button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .card {
        border-radius: var(--radius-lg);
    }
}

/* ============================================
   Dark Mode Enhancements
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-dark: #0b0e11;
        --bg-card: #1e2229;
    }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}