/* ============================================================
   Mis Sorteos CR - Main Stylesheet
   Diseño moderno, mobile-first, inspiración costarricense
   ============================================================ */

/* Variables */
:root {
    --primary: #1a56db;
    --primary-dark: #1243af;
    --primary-light: #e8f0fe;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0284c7;

    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);

    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Base */
* { box-sizing: border-box; }

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 70px;
}

@media (min-width: 992px) {
    body { padding-bottom: 0; }
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body { padding: 1.25rem; }
.card-footer { background: transparent; border-top: 1px solid var(--border-color); }

/* Status badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 50px;
    font-size: 0.75rem;
}

/* Buttons */
.btn {
    border-radius: var(--radius);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success { background: var(--success); border-color: var(--success); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-warning { background: var(--warning); border-color: var(--warning); }
.btn-info { background: var(--info); border-color: var(--info); }

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

.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.875rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

/* Forms */
.form-control, .form-select {
    border-radius: var(--radius);
    border-color: var(--border-color);
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.15);
}
.form-label { font-weight: 500; font-size: 0.875rem; color: var(--text-secondary); }
.is-invalid { border-color: var(--danger) !important; }
.invalid-feedback { font-size: 0.8rem; }

/* Navbar */
.navbar { padding: 0.625rem 1rem; }
.navbar-brand { font-size: 1.125rem; letter-spacing: -0.02em; }
.nav-link { font-weight: 500; font-size: 0.9rem; padding: 0.5rem 0.75rem !important; border-radius: var(--radius); }
.nav-link:hover { background: rgba(255,255,255,0.1); }

/* Dropdown */
.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}
.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}
.dropdown-item:hover { background: var(--primary-light); color: var(--primary); }
.dropdown-item:active { background: var(--primary); color: white; }

/* Bottom nav (mobile) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    z-index: 1030;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.65rem;
    text-decoration: none;
    padding: 0.25rem 0;
    transition: color 0.15s ease;
    gap: 1px;
}
.bottom-nav-item:hover, .bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item i { font-size: 1.25rem; }

.bottom-nav .add-btn {
    margin-top: -15px;
    color: var(--primary);
}
.bottom-nav .add-btn i {
    font-size: 2rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(26, 86, 219, 0.4);
}
.bottom-nav .add-btn:hover i {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(26, 86, 219, 0.5);
}

/* Dashboard cards */
.stat-card {
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: none;
    position: relative;
    overflow: hidden;
}
.stat-card .stat-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 4rem;
    opacity: 0.1;
}
.stat-card .stat-number { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat-card .stat-label { font-size: 0.875rem; opacity: 0.85; }

/* Hero */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    color: white;
    padding: 4rem 0;
    min-height: 400px;
    display: flex;
    align-items: center;
}

.hero-section h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; }
.hero-section p { font-size: 1.125rem; opacity: 0.9; }

@media (max-width: 768px) {
    .hero-section { padding: 3rem 0; min-height: 300px; }
    .hero-section h1 { font-size: 1.75rem; }
}

/* Ticket cards */
.ticket-card {
    border-left: 4px solid var(--primary);
    transition: all 0.2s ease;
}
.ticket-card.winner { border-left-color: var(--success); }
.ticket-card.not-winner { border-left-color: var(--text-muted); }
.ticket-card.pending { border-left-color: var(--warning); }
.ticket-card.needs-review { border-left-color: var(--danger); }

/* Game icons */
.game-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

/* Tables */
.table {
    --bs-table-hover-bg: var(--primary-light);
}
.table th { font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); border-bottom-width: 1px; }
.table td { vertical-align: middle; }

/* Alerts */
.alert { border-radius: var(--radius-lg); }
.alert-dismissible .btn-close { padding: 1rem; }

/* Utilities */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-soft-primary { background: var(--primary-light); }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}
.empty-state i { font-size: 3rem; color: var(--text-muted); margin-bottom: 1rem; }

.transition { transition: all 0.2s ease; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.3s ease forwards; }
.animate-fade-in-delay { animation: fadeIn 0.5s ease forwards; animation-delay: 0.1s; opacity: 0; }

/* Print */
@media print {
    .bottom-nav, .navbar, footer { display: none !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd; }
}

/* Responsive sidebar for desktop */
@media (min-width: 992px) {
    .main-content {
        min-height: calc(100vh - 56px);
    }
}

/* Offline page */
.offline-page {
    text-align: center;
    padding: 4rem 1rem;
}
.offline-page i { font-size: 4rem; color: var(--text-muted); }
