/* ============================================
   SISTEMA DE SORTEIO DE PRÊMIOS
   Tema: Festivo e Alegre
   ============================================ */

:root {
    /* Cores principais - Alegres e festivas */
    --primary: #FF6B6B;
    --primary-dark: #EE5A5A;
    --secondary: #4ECDC4;
    --accent-yellow: #FFE66D;
    --accent-purple: #A66CFF;
    --accent-blue: #54B4D3;
    --accent-green: #95E1A3;
    --accent-orange: #FFA94D;
    
    /* Backgrounds */
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-light: #F8F9FE;
    --bg-white: #FFFFFF;
    --bg-card: #FFFFFF;
    
    /* Textos */
    --text-dark: #2D3748;
    --text-medium: #4A5568;
    --text-light: #718096;
    --text-muted: #A0AEC0;
    
    /* Status */
    --success: #48BB78;
    --warning: #ECC94B;
    --danger: #F56565;
    --info: #4299E1;
    
    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ============================================
   BASE
   ============================================ */
body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

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

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    padding: 0.75rem 0;
    background: white !important;
}

.brand-icon {
    font-size: 2rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.brand-text {
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    font-weight: 500;
    color: var(--text-medium) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    margin: 0 0.125rem;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--bg-light);
    color: var(--primary) !important;
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white !important;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-title i {
    color: var(--primary);
}

.page-subtitle {
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: white;
    min-height: 140px;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.stat-card.primary {
    background: linear-gradient(135deg, var(--primary), #ff8e8e);
}

.stat-card.secondary {
    background: linear-gradient(135deg, var(--secondary), #7ee8e1);
}

.stat-card.purple {
    background: linear-gradient(135deg, var(--accent-purple), #c9a7ff);
}

.stat-card.orange {
    background: linear-gradient(135deg, var(--accent-orange), #ffc078);
}

.stat-card.green {
    background: linear-gradient(135deg, var(--success), #68d391);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.9;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 500;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #38a169);
    border: none;
}

.btn-info {
    background: linear-gradient(135deg, var(--secondary), #38b2ac);
    border: none;
    color: white;
}

.btn-info:hover {
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--accent-yellow), #f6e05e);
    border: none;
    color: var(--text-dark);
}

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

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

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.1rem;
    border-radius: var(--radius-md);
}

/* ============================================
   FORMS
   ============================================ */
.form-control, .form-select {
    border: 2px solid #E2E8F0;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--text-medium);
    margin-bottom: 0.5rem;
}

.input-group-text {
    background: var(--bg-light);
    border: 2px solid #E2E8F0;
    border-right: none;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--bg-light);
    border-bottom: none;
    font-weight: 600;
    color: var(--text-medium);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-color: #EDF2F7;
}

.table tbody tr:hover {
    background: rgba(255, 107, 107, 0.03);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    font-weight: 500;
    padding: 0.5em 0.85em;
    border-radius: 50px;
}

.badge-setor {
    background: rgba(78, 205, 196, 0.15);
    color: #2c9a91;
}

.badge-ganhador {
    background: rgba(255, 107, 107, 0.15);
    color: var(--primary);
}

.badge-disponivel {
    background: rgba(72, 187, 120, 0.15);
    color: #2f855a;
}

/* ============================================
   UPLOAD AREA
   ============================================ */
.upload-area {
    border: 3px dashed #CBD5E0;
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--bg-light);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(255, 107, 107, 0.05);
}

.upload-area .upload-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-area .upload-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.upload-area .upload-hint {
    color: var(--text-light);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f64f59 100%);
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
    padding: 2rem;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-container {
    background: white;
    border-radius: var(--radius-xl);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
}

.login-logo {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 1rem;
    animation: bounce 2s ease-in-out infinite;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* ============================================
   SORTEIO LIVE
   ============================================ */
.live-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    z-index: 9999;
    display: none;
    flex-direction: column;
}

.live-overlay.active {
    display: flex;
}

.live-header {
    padding: 1.5rem 2rem;
    background: rgba(0,0,0,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.live-badge {
    background: #EF4444;
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: pulse 2s ease-in-out infinite;
}

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

.live-badge::before {
    content: '';
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
}

.live-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.slot-machine {
    text-align: center;
    width: 100%;
    max-width: 800px;
}

.slot-container {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-xl);
    padding: 3rem;
    margin-bottom: 2rem;
}

.slot-label {
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
}

.slot-display {
    background: rgba(0,0,0,0.4);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 1rem;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.slot-name {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
}

.slot-name.spinning {
    animation: slotSpin 0.08s linear infinite;
    color: rgba(255,255,255,0.5);
}

.slot-name.winner {
    color: var(--accent-yellow);
    text-shadow: 0 0 30px rgba(255, 230, 109, 0.5);
    animation: winnerReveal 0.5s ease-out;
}

@keyframes slotSpin {
    0% { transform: translateY(-50%); opacity: 0; }
    50% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(50%); opacity: 0; }
}

@keyframes winnerReveal {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.slot-sector {
    color: var(--secondary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.slot-prize {
    color: var(--accent-yellow);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.btn-spin {
    background: linear-gradient(135deg, var(--accent-yellow), #f6e05e);
    color: #744210;
    font-size: 1.5rem;
    font-weight: 800;
    padding: 1.25rem 4rem;
    border-radius: var(--radius-lg);
    border: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 10px 30px rgba(255, 230, 109, 0.4);
    transition: all 0.3s ease;
}

.btn-spin:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 230, 109, 0.5);
    color: #744210;
}

.btn-spin:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Winners Panel */
.winners-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 350px;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 10000;
}

.winners-panel.open {
    transform: translateX(0);
}

.winners-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    color: white;
}

.winner-item {
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    color: white;
}

.winner-item .winner-position {
    width: 32px;
    height: 32px;
    background: var(--accent-yellow);
    color: #744210;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.winner-item .winner-prize {
    color: var(--accent-yellow);
    font-weight: 600;
    font-size: 0.875rem;
}

.winner-item .winner-name {
    font-weight: 600;
    margin-top: 0.5rem;
}

.winner-item .winner-sector {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
}

/* Progress */
.live-progress {
    margin-top: 2rem;
    color: white;
}

.live-progress .progress {
    height: 12px;
    border-radius: 50px;
    background: rgba(255,255,255,0.2);
}

.live-progress .progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--accent-yellow));
    border-radius: 50px;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state .empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 0.5rem;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: white !important;
    border-top: 1px solid #EDF2F7;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .slot-name {
        font-size: 2rem;
    }
    
    .winners-panel {
        width: 100%;
    }
    
    .btn-spin {
        padding: 1rem 2rem;
        font-size: 1.25rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

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

.rounded-xl {
    border-radius: var(--radius-xl);
}
