/* =====================================================
   SISTEMA DE SORTEIOS - DESIGN CSFLOAT
   Versão: 2.1 - Cards com Raridade e Float Bar
   ===================================================== */

/* ========== VARIÁVEIS DE RARIDADE CS2 ========== */
:root {
    --rarity-consumer: #b0c3d9;
    --rarity-industrial: #5e98d9;
    --rarity-milspec: #4b69ff;
    --rarity-restricted: #8847ff;
    --rarity-classified: #d32ce6;
    --rarity-covert: #eb4b4b;
    --rarity-contraband: #e4ae39;
    --rarity-extraordinary: #ffd700;
    
    --float-fn: #4ade80;
    --float-mw: #a3e635;
    --float-ft: #fbbf24;
    --float-ww: #f97316;
    --float-bs: #ef4444;
    
    /* Background principal */
    --bg-main: #141517;
    --bg-card: linear-gradient(180deg, #1a1f28 0%, #12161d 100%);
    --bg-card-image: linear-gradient(180deg, #0d1117 0%, #161b22 100%);
}



/* ========== MAIN CONTENT - BACKGROUND ========== */
.main-content {
    margin-left: 240px;
    min-height: 100vh;
    background: var(--bg-main);
}

/* ========== TOPBAR ========== */
.topbar {
    padding: 14px 20px;
    background: rgba(13, 13, 13, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
}

/* ========== CONTENT CONTAINER ========== */
.content-container {
    padding: 20px;
    max-width: 1300px;
}

/* ========== GRID DE SORTEIOS ========== */
.raffles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

@media (min-width: 1400px) {
    .raffles-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 576px) {
    .raffles-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ========== CARD PRINCIPAL ========== */
.raffle-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.raffle-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

.raffle-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.raffle-card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* ========== ÁREA DA IMAGEM - QUADRADA 1:1 ========== */
.raffle-card-image {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Cria o quadrado 1:1 */
    background: var(--bg-card-image);
    overflow: hidden;
}

.raffle-card-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 12%;
}

.raffle-card-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
}

.raffle-card:hover .raffle-card-image-wrapper img {
    transform: scale(1.08);
}

.raffle-card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.2);
}

.raffle-card-image-placeholder svg {
    width: 48px;
    height: 48px;
}

/* ========== BADGES ========== */
.raffle-card-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 5;
}

.badges-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.badges-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.badge-type {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-free {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
}

.badge-paid {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
}

.badge-bingo {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #ffffff;
}

.badge-live {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-waiting {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-ending {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    animation: pulse-badge 1.5s infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.badge-timer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.badge-timer-live {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.badge-timer-ending {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    animation: pulse-badge 1.5s infinite;
}

/* ========== GRADIENTE RADIAL CENTRAL ========== */
.rarity-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140%;
    height: 140%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
}

.rarity-consumer .rarity-glow { background: radial-gradient(ellipse at center, rgba(176, 195, 217, 0.25) 0%, transparent 55%); }
.rarity-industrial .rarity-glow { background: radial-gradient(ellipse at center, rgba(94, 152, 217, 0.25) 0%, transparent 55%); }
.rarity-milspec .rarity-glow { background: radial-gradient(ellipse at center, rgba(75, 105, 255, 0.25) 0%, transparent 55%); }
.rarity-restricted .rarity-glow { background: radial-gradient(ellipse at center, rgba(136, 71, 255, 0.25) 0%, transparent 55%); }
.rarity-classified .rarity-glow { background: radial-gradient(ellipse at center, rgba(211, 44, 230, 0.25) 0%, transparent 55%); }
.rarity-covert .rarity-glow { background: radial-gradient(ellipse at center, rgba(235, 75, 75, 0.25) 0%, transparent 55%); }
.rarity-contraband .rarity-glow { background: radial-gradient(ellipse at center, rgba(228, 174, 57, 0.3) 0%, transparent 55%); }
.rarity-extraordinary .rarity-glow { background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.3) 0%, transparent 55%); }

/* ========== GRADIENTE INFERIOR ========== */
.rarity-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    pointer-events: none;
    z-index: 1;
}

.rarity-consumer .rarity-gradient { background: linear-gradient(180deg, transparent 0%, rgba(176, 195, 217, 0.12) 100%); }
.rarity-industrial .rarity-gradient { background: linear-gradient(180deg, transparent 0%, rgba(94, 152, 217, 0.12) 100%); }
.rarity-milspec .rarity-gradient { background: linear-gradient(180deg, transparent 0%, rgba(75, 105, 255, 0.12) 100%); }
.rarity-restricted .rarity-gradient { background: linear-gradient(180deg, transparent 0%, rgba(136, 71, 255, 0.12) 100%); }
.rarity-classified .rarity-gradient { background: linear-gradient(180deg, transparent 0%, rgba(211, 44, 230, 0.12) 100%); }
.rarity-covert .rarity-gradient { background: linear-gradient(180deg, transparent 0%, rgba(235, 75, 75, 0.12) 100%); }
.rarity-contraband .rarity-gradient { background: linear-gradient(180deg, transparent 0%, rgba(228, 174, 57, 0.15) 100%); }
.rarity-extraordinary .rarity-gradient { background: linear-gradient(180deg, transparent 0%, rgba(255, 215, 0, 0.15) 100%); }

/* ========== BORDA INFERIOR DE RARIDADE ========== */
.rarity-border {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 3;
}

.rarity-consumer .rarity-border { background: linear-gradient(90deg, transparent 0%, var(--rarity-consumer) 50%, transparent 100%); }
.rarity-industrial .rarity-border { background: linear-gradient(90deg, transparent 0%, var(--rarity-industrial) 50%, transparent 100%); }
.rarity-milspec .rarity-border { background: linear-gradient(90deg, transparent 0%, var(--rarity-milspec) 50%, transparent 100%); }
.rarity-restricted .rarity-border { background: linear-gradient(90deg, transparent 0%, var(--rarity-restricted) 50%, transparent 100%); }
.rarity-classified .rarity-border { background: linear-gradient(90deg, transparent 0%, var(--rarity-classified) 50%, transparent 100%); }
.rarity-covert .rarity-border { background: linear-gradient(90deg, transparent 0%, var(--rarity-covert) 50%, transparent 100%); }
.rarity-contraband .rarity-border { background: linear-gradient(90deg, transparent 0%, var(--rarity-contraband) 50%, transparent 100%); }
.rarity-extraordinary .rarity-border { background: linear-gradient(90deg, transparent 0%, var(--rarity-extraordinary) 50%, transparent 100%); }

/* ========== STATUS OVERLAY ========== */
.raffle-status-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 10;
    backdrop-filter: blur(8px);
}

.status-ended {
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
}

.status-winner {
    background: rgba(16, 185, 129, 0.9);
    color: #fff;
}

/* ========== CONTEÚDO DO CARD ========== */
.raffle-card-content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.raffle-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 3px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.raffle-card-wear {
    font-size: 0.75rem;
    color: #8b93a7;
    margin: 0 0 10px 0;
}

/* ========== FLOAT BAR ========== */
.float-bar-container {
    margin-bottom: 12px;
}

.float-bar {
    position: relative;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, 
        var(--float-fn) 0%, 
        var(--float-fn) 7%, 
        var(--float-mw) 7%, 
        var(--float-mw) 15%, 
        var(--float-ft) 15%, 
        var(--float-ft) 38%, 
        var(--float-ww) 38%, 
        var(--float-ww) 45%, 
        var(--float-bs) 45%, 
        var(--float-bs) 100%
    );
    overflow: visible;
}

.float-indicator {
    position: absolute;
    top: -3px;
    width: 3px;
    height: 12px;
    background: #ffffff;
    border-radius: 1px;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    transform: translateX(-50%);
}

.float-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.float-value {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.7rem;
    color: #8b93a7;
}

.float-wear {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* ========== PROGRESS BAR (BINGO) ========== */
.card-progress {
    margin-bottom: 12px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #8b93a7;
    margin-bottom: 5px;
}

.progress-bar {
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 4px;
}

/* ========== FOOTER DO CARD ========== */
.raffle-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
}

.raffle-card-price-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.raffle-card-price-label {
    font-size: 0.6rem;
    color: #6b7280;
    text-transform: uppercase;
}

.raffle-card-price {
    font-size: 1rem;
    font-weight: 700;
    color: #10b981;
}

.raffle-card-price.price-free {
    color: #10b981;
}

/* Card Live */
.card-live {
    border-color: rgba(239, 68, 68, 0.3);
    animation: glow-live 2s infinite;
}

@keyframes glow-live {
    0%, 100% { box-shadow: 0 0 15px rgba(239, 68, 68, 0.15); }
    50% { box-shadow: 0 0 25px rgba(239, 68, 68, 0.25); }
}

/* Card Ending Soon */
.card-ending-soon {
    animation: glow-ending 2s infinite;
}

@keyframes glow-ending {
    0%, 100% { box-shadow: 0 0 15px rgba(239, 68, 68, 0.15); }
    50% { box-shadow: 0 0 25px rgba(239, 68, 68, 0.3); }
}

/* ========== CORES DO PREÇO POR RARIDADE ========== */
.rarity-consumer .raffle-card-price { color: #b0c3d9; }
.rarity-industrial .raffle-card-price { color: #5e98d9; }
.rarity-milspec .raffle-card-price { color: #4b69ff; }
.rarity-restricted .raffle-card-price { color: #8847ff; }
.rarity-classified .raffle-card-price { color: #d32ce6; }
.rarity-covert .raffle-card-price { color: #eb4b4b; }
.rarity-contraband .raffle-card-price { color: #e4ae39; }
.rarity-extraordinary .raffle-card-price { color: #ffd700; }

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.empty-state-text {
    color: #8b93a7;
    max-width: 400px;
    margin: 0 auto;
}

/* ========== RESPONSIVO ========== */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 10px 14px;
        padding-left: 65px;
    }
    
    .page-title {
        font-size: 0.95rem;
    }
    
    .content-container {
        padding: 14px;
    }
    
    .raffles-grid,
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .raffle-card-content {
        padding: 12px;
    }
    
    .raffle-card-title {
        font-size: 0.85rem;
    }
}

/* ========== ADMIN STYLES ========== */
/* Mantém os estilos admin existentes... */

.rarity-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.rarity-option {
    position: relative;
}

.rarity-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.rarity-option-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rarity-option-label:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.rarity-option input:checked + .rarity-option-label {
    background: rgba(255, 255, 255, 0.05);
}

.rarity-option input:checked + .rarity-option-label.label-consumer { border-color: var(--rarity-consumer); }
.rarity-option input:checked + .rarity-option-label.label-industrial { border-color: var(--rarity-industrial); }
.rarity-option input:checked + .rarity-option-label.label-milspec { border-color: var(--rarity-milspec); }
.rarity-option input:checked + .rarity-option-label.label-restricted { border-color: var(--rarity-restricted); }
.rarity-option input:checked + .rarity-option-label.label-classified { border-color: var(--rarity-classified); }
.rarity-option input:checked + .rarity-option-label.label-covert { border-color: var(--rarity-covert); }
.rarity-option input:checked + .rarity-option-label.label-contraband { border-color: var(--rarity-contraband); }
.rarity-option input:checked + .rarity-option-label.label-extraordinary { border-color: var(--rarity-extraordinary); }

.rarity-color-dot {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.rarity-option-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rarity-option-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
}

.rarity-option-desc {
    color: #8b93a7;
    font-size: 0.75rem;
}

/* Admin cards */
.admin-card {
    background: linear-gradient(145deg, #1e242e, #181d26);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.admin-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

.admin-card-header h6 {
    margin: 0;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
}

.admin-card-body {
    padding: 20px;
}

/* Form controls */
.form-group-admin {
    margin-bottom: 20px;
}

.form-group-admin:last-child {
    margin-bottom: 0;
}

.form-label-admin {
    display: block;
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.form-control-admin {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control-admin:focus {
    outline: none;
    border-color: #ff1647;
    box-shadow: 0 0 0 3px rgba(255, 22, 71, 0.15);
}

.form-control-admin::placeholder {
    color: #5a6275;
}

.form-hint {
    margin-top: 6px;
    color: #8b93a7;
    font-size: 0.8rem;
}

/* Buttons */
.btn-admin {
    padding: 14px 32px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-admin-primary {
    background: linear-gradient(135deg, #ff1647, #cc1138);
    color: #ffffff;
}

.btn-admin-primary:hover {
    background: linear-gradient(135deg, #ff2d5c, #d91f47);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 22, 71, 0.3);
    color: #ffffff;
}

.btn-admin-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.btn-admin-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}