/* ===== LOTO 5/40 ANALYZER PRO — FRONTEND STYLES ===== */

:root {
    --loto-primary: #1a1a2e;
    --loto-secondary: #16213e;
    --loto-accent: #e94560;
    --loto-gold: #f5a623;
    --loto-green: #0f9b58;
    --loto-blue: #4a90d9;
    --loto-text: #333;
    --loto-light: #f8f9fa;
    --loto-border: #e0e0e0;
    --loto-radius: 12px;
    --loto-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.loto540-wrap * { box-sizing: border-box; }

.loto540-wrap {
    font-family: 'Segoe UI', system-ui, sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    color: var(--loto-text);
}

/* ===== TABS ===== */
.loto540-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: var(--loto-primary);
    padding: 12px;
    border-radius: var(--loto-radius) var(--loto-radius) 0 0;
}

.loto540-tab {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.loto540-tab:hover { background: rgba(255,255,255,0.2); }
.loto540-tab.active { background: var(--loto-accent); color: #fff; }

/* ===== PANELS ===== */
.loto540-panel {
    display: none;
    background: #fff;
    padding: 24px;
    border: 1px solid var(--loto-border);
    border-top: none;
    border-radius: 0 0 var(--loto-radius) var(--loto-radius);
    min-height: 400px;
}

.loto540-panel.active { display: block; }
.loto540-panel h2 { margin: 0 0 20px; color: var(--loto-primary); font-size: 1.4rem; }
.loto540-panel h3 { color: var(--loto-secondary); margin: 16px 0 10px; }

/* ===== CARDS ===== */
.loto540-card {
    background: var(--loto-light);
    border: 1px solid var(--loto-border);
    border-radius: var(--loto-radius);
    padding: 20px;
    margin-bottom: 20px;
}

/* ===== FORM ===== */
.loto540-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.loto540-form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    color: #555;
}

.loto540-form-group select,
.loto540-form-group input[type="date"],
.loto540-form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--loto-border);
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: border 0.2s;
}

.loto540-form-group select:focus,
.loto540-form-group input:focus { border-color: var(--loto-accent); outline: none; }

/* ===== BUTTONS ===== */
.loto540-btn {
    padding: 11px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.loto540-btn-primary { background: var(--loto-accent); color: #fff; }
.loto540-btn-primary:hover { background: #c73652; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(233,69,96,0.4); }
.loto540-btn-secondary { background: var(--loto-green); color: #fff; }
.loto540-btn-secondary:hover { background: #0a7d48; }
.loto540-btn-outline { background: transparent; color: var(--loto-primary); border: 2px solid var(--loto-primary); }
.loto540-btn-outline:hover { background: var(--loto-primary); color: #fff; }
.loto540-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== TICKET CARD ===== */
.loto540-tickets-container h3 { margin-bottom: 16px; }

.loto540-ticket {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    border-radius: var(--loto-radius);
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--loto-shadow);
    position: relative;
    overflow: hidden;
}

.loto540-ticket::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 120px; height: 120px;
    background: rgba(233,69,96,0.1);
    border-radius: 50%;
}

.loto540-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: 13px;
    opacity: 0.7;
}

.loto540-ticket-method {
    background: var(--loto-accent);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    opacity: 1;
    color: #fff;
}

.loto540-ticket-numbers {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 10px 0;
}

.loto540-ball {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f5a623, #e8920a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(245,166,35,0.5);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}

.loto540-ball:hover { transform: scale(1.1); }

.loto540-ticket-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    justify-content: flex-end;
}

.loto540-ticket-btn {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.loto540-ticket-btn:hover { background: rgba(255,255,255,0.25); }

.loto540-actions-bar {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* ===== FREQUENCY CHART ===== */
.loto540-chart-wrap {
    background: #fff;
    border-radius: var(--loto-radius);
    padding: 16px;
    margin: 16px 0;
    border: 1px solid var(--loto-border);
    overflow-x: auto;
}

.loto540-chart-wrap canvas { max-height: 300px; }

/* ===== HOT/COLD ===== */
.loto540-hot-cold {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.loto540-hot, .loto540-cold {
    background: var(--loto-light);
    border-radius: var(--loto-radius);
    padding: 16px;
}

.loto540-hot h4 { color: #e94560; margin: 0 0 12px; }
.loto540-cold h4 { color: var(--loto-blue); margin: 0 0 12px; }

.loto540-num-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--loto-border);
    padding: 5px 10px;
    border-radius: 20px;
    margin: 4px;
    font-size: 13px;
    font-weight: 600;
}

.loto540-num-chip .chip-num {
    background: var(--loto-accent);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.loto540-cold .loto540-num-chip .chip-num { background: var(--loto-blue); }

/* ===== SUMMARY BAR ===== */
.loto540-summary-bar {
    background: var(--loto-primary);
    color: #fff;
    padding: 14px 20px;
    border-radius: var(--loto-radius);
    margin-bottom: 16px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
}

.loto540-summary-bar strong { color: var(--loto-gold); }

/* ===== GRID VIEW ===== */
.loto540-num-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    padding: 16px;
}

.loto540-grid-cell {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    cursor: default;
    transition: transform 0.2s;
}

.loto540-grid-cell:hover { transform: scale(1.05); }
.loto540-grid-cell .cell-count { font-size: 10px; font-weight: 400; opacity: 0.8; }

/* ===== ARCHIVE TABLE ===== */
.loto540-archive-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 16px;
}

.loto540-archive-table th {
    background: var(--loto-primary);
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
}

.loto540-archive-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--loto-border);
}

.loto540-archive-table tr:hover td { background: #f8f0ff; }

.loto540-archive-table .draw-num {
    display: inline-flex;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--loto-gold);
    color: #fff;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    margin: 2px;
}

/* ===== PREDICTIONS ===== */
.loto540-pred-card {
    background: #fff;
    border: 1px solid var(--loto-border);
    border-left: 4px solid var(--loto-accent);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.loto540-pred-numbers { display: flex; gap: 8px; flex-wrap: wrap; }
.loto540-pred-num {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--loto-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.loto540-pred-meta { flex: 1; font-size: 13px; color: #666; }
.loto540-pred-meta strong { color: var(--loto-primary); }

.loto540-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.badge-pending { background: #fff3cd; color: #856404; }
.badge-verified { background: #d1e7dd; color: #0f5132; }

/* ===== STATS GRID ===== */
.loto540-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.loto540-stat-card {
    background: var(--loto-primary);
    color: #fff;
    border-radius: var(--loto-radius);
    padding: 20px;
    text-align: center;
}

.loto540-stat-card .s-num { font-size: 2rem; font-weight: 700; color: var(--loto-gold); }
.loto540-stat-card .s-label { font-size: 13px; opacity: 0.7; margin-top: 4px; }

/* ===== PAGINATION ===== */
.loto540-pagination {
    display: flex;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.loto540-page-btn {
    padding: 6px 12px;
    border: 1px solid var(--loto-border);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.loto540-page-btn:hover { background: var(--loto-primary); color: #fff; }
.loto540-page-btn.active { background: var(--loto-accent); color: #fff; border-color: var(--loto-accent); }

/* ===== INFO / LOADING ===== */
.loto540-info {
    background: #e8f4fd;
    border-left: 4px solid var(--loto-blue);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    margin-bottom: 16px;
}

.loto540-loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

.loto540-spinner {
    display: inline-block;
    width: 24px; height: 24px;
    border: 3px solid #ddd;
    border-top-color: var(--loto-accent);
    border-radius: 50%;
    animation: loto-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes loto-spin { to { transform: rotate(360deg); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .loto540-tabs { flex-direction: column; }
    .loto540-hot-cold { grid-template-columns: 1fr; }
    .loto540-ball { width: 42px; height: 42px; font-size: 15px; }
    .loto540-ticket-numbers { gap: 8px; }
    .loto540-num-grid { grid-template-columns: repeat(5, 1fr); }
}

@media print {
    .loto540-tabs, .loto540-btn, .loto540-ticket-actions,
    .loto540-actions-bar { display: none !important; }
    .loto540-panel { display: block !important; border: none; }
    .loto540-ticket { break-inside: avoid; }
}