/**
 * Talacote Simulator — extracted from simulator-component.html
 * (Audit fix #4 — Apr 2026): was 18 KB inline CSS injected into the
 * page <head> for every simulator render. Now external + cached.
 * Loaded conditionally via inc/shortcodes.php only when the
 * [talacote_simulator] shortcode is present.
 */

.tc-simulator-wrap {
    font-family: Arial, sans-serif;
    color: #e8f5ec;
    background: transparent;
    line-height: 1.6;
}

.tc-simulator-wrap .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(13, 21, 16, 0.85);
    border-radius: 18px;
    min-height: auto;
}

/* Header */
.tc-simulator-wrap .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(27, 38, 64, 0.6);
    border-radius: 10px;
    margin-bottom: 30px;
}

.tc-simulator-wrap .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tc-simulator-wrap .logo-icon {
    width: 50px;
    height: 50px;
    background: #22c55e;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.tc-simulator-wrap .logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #22c55e;
}

.tc-simulator-wrap .premium-badge {
    display: none;
    background: gold;
    color: #e8f5ec;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
}

.tc-simulator-wrap .premium-badge.show {
    display: block;
}

/* Usage Banner */
.tc-simulator-wrap .usage-banner {
    background: #ff9800;
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    font-weight: bold;
}
.tc-simulator-wrap .usage-banner.hidden {
    display: none;
}

/* Tabs */
.tc-simulator-wrap .tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .tc-simulator-wrap .tabs {
        display: flex;
        overflow-x: auto;
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
        grid-template-columns: none;
        gap: 5px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
}

.tc-simulator-wrap .tab {
    padding: 12px;
    background: rgba(27, 38, 64, 0.6);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #e2ebe5;
    transition: all 0.3s;
    white-space: nowrap;
    text-align: center;
}

@media (max-width: 768px) {
    .tc-simulator-wrap .tab {
        background: none;
        border: none;
        border-radius: 0;
        border-bottom: 3px solid transparent;
        flex-shrink: 0;
        scroll-snap-align: center;
    }
}

.tc-simulator-wrap .tab:hover {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
    border-color: #22c55e;
}

@media (max-width: 768px) {
    .tc-simulator-wrap .tab:hover {
        background: none;
    }
}

.tc-simulator-wrap .tab.active {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    font-weight: bold;
}

@media (max-width: 768px) {
    .tc-simulator-wrap .tab.active {
        background: none;
        border-bottom: 3px solid #22c55e;
    }
}

.tc-simulator-wrap .tab-content {
    display: none;
}
.tc-simulator-wrap .tab-content.active {
    display: block;
}

/* Forms */
.tc-simulator-wrap .form-group {
    margin-bottom: 20px;
}

.tc-simulator-wrap label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    /* Explicit light color — without this, labels inherit from the
       parent theme and render as dark-blue-on-dark-background
       (invisible on mobile + desktop). Reported UX bug 2026-04. */
    color: #e8f5ec;
    /* Audit fix #12 (Apr 2026): bumped from 14px → 15px to meet
       WCAG 2.2 minimum readable size on small mobile labels. */
    font-size: 15px;
    letter-spacing: 0.01em;
}

.tc-simulator-wrap input, .tc-simulator-wrap select {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 5px;
    font-size: 16px;
    background: rgba(19, 27, 46, 0.9);
    color: #e8f5ec;
}

.tc-simulator-wrap input:focus, .tc-simulator-wrap select:focus {
    outline: none;
    border-color: #22c55e;
}

/* Buttons */
.tc-simulator-wrap button {
    background: #22c55e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin-right: 10px;
    margin-bottom: 10px;
}

.tc-simulator-wrap button:hover {
    background: #16a34a;
}

.tc-simulator-wrap button.secondary {
    background: #ddd;
    color: #e8f5ec;
}

/* Odds List */
.tc-simulator-wrap .odds-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 50px;
    padding: 15px;
    background: rgba(27, 38, 64, 0.6);
    border-radius: 8px;
    margin: 20px 0;
}

.tc-simulator-wrap .odd-badge {
    background: #22c55e;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tc-simulator-wrap .remove-odd {
    background: rgba(255,255,255,0.3);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Results */
.tc-simulator-wrap .results {
    background: rgba(27, 38, 64, 0.6);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border-left: 4px solid #22c55e;
}

.tc-simulator-wrap .result-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.tc-simulator-wrap .result-row:last-child {
    border: none;
    margin: 0;
    padding: 0;
}

.tc-simulator-wrap .gain {
    color: #22c55e;
    font-size: 20px;
    font-weight: bold;
}

/* Breakdown Table */
.tc-simulator-wrap .breakdown-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
}

.tc-simulator-wrap .breakdown-table th {
    background: #22c55e;
    color: white;
    padding: 10px;
    /* Tâche 30: logical start anchors header to reading-flow start */
    text-align: start;
}

.tc-simulator-wrap .breakdown-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 768px) {
    .tc-simulator-wrap .breakdown-table {
        font-size: 12px;
    }
    .tc-simulator-wrap .breakdown-table th,
    .tc-simulator-wrap .breakdown-table td {
        padding: 8px 5px;
    }
    .tc-simulator-wrap .results {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .tc-simulator-wrap .breakdown-table-mobile {
        display: none;
    }
}

@media (max-width: 480px) {
    .tc-simulator-wrap .breakdown-table th,
    .tc-simulator-wrap .breakdown-table td {
        padding: 6px 4px;
        font-size: 11px;
    }
}

.tc-simulator-wrap .profit-positive {
    color: #22c55e;
    font-weight: bold;
}

.tc-simulator-wrap .profit-negative {
    color: #f44336;
    font-weight: bold;
}

.tc-simulator-wrap .probability-column {
    color: #e2ebe5;
    font-weight: normal;
}

.tc-simulator-wrap .probability-positive {
    color: #22c55e;
}

.tc-simulator-wrap .probability-negative {
    color: #f44336;
}

/* Share */
.tc-simulator-wrap .share-section {
    margin-top: 20px;
    padding: 20px;
    background: rgba(27, 38, 64, 0.6);
    border-radius: 10px;
    text-align: center;
}

.tc-simulator-wrap .share-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.tc-simulator-wrap .share-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    margin: 0;
}

.tc-simulator-wrap .share-facebook { background: #1877f2; }
.tc-simulator-wrap .share-whatsapp { background: #25d366; }
.tc-simulator-wrap .share-twitter  { background: #1da1f2; }
.tc-simulator-wrap .share-telegram { background: #0088cc; }
.tc-simulator-wrap .share-tiktok   { background: #000; }

/* History */
.tc-simulator-wrap .history-item {
    background: rgba(27, 38, 64, 0.6);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    border-left: 4px solid #22c55e;
}

.tc-simulator-wrap .history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.tc-simulator-wrap .history-type {
    font-weight: bold;
    color: #22c55e;
}

.tc-simulator-wrap .history-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.tc-simulator-wrap .history-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.tc-simulator-wrap .history-actions button {
    padding: 5px 10px;
    font-size: 14px;
}

/* Stats */
.tc-simulator-wrap .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tc-simulator-wrap .stat-card {
    background: rgba(27, 38, 64, 0.6);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.tc-simulator-wrap .stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #22c55e;
}

/* Modal */
.tc-simulator-wrap .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
}

.tc-simulator-wrap .modal.show {
    display: block;
}

.tc-simulator-wrap .modal-content {
    background: rgba(19, 27, 46, 0.9);
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

@media (max-height: 600px) {
    .tc-simulator-wrap .modal-content {
        top: 20px;
        transform: translateX(-50%);
        max-height: calc(100vh - 40px);
    }
}

.tc-simulator-wrap .empty-state {
    text-align: center;
    padding: 40px;
    color: #e2ebe5;
}

/* Hero block (logo + heading + paragraphs) — was inline style="" in
   simulator-component.html, externalized in audit fix #4. */
.tc-simulator-wrap .tc-sim-hero {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 12px;
}
.tc-simulator-wrap .tc-sim-hero__emoji {
    font-size: 58px;
    vertical-align: middle;
}
.tc-simulator-wrap .tc-sim-hero__brand {
    font-size: 72px;
    font-weight: bold;
    color: #28d17c;
    margin: 0 8px;
}
.tc-simulator-wrap .tc-sim-h2 {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #e8f5ec;
    margin: 6px auto 10px;
    max-width: 92%;
}
.tc-simulator-wrap .tc-sim-h2--sub {
    font-size: 18px;
    font-weight: 600;
    color: #dde6f5;
    margin: 4px auto 12px;
}
.tc-simulator-wrap .tc-sim-lede,
.tc-simulator-wrap .tc-sim-caption {
    text-align: center;
    color: #e2ebe5;
    font-size: 15px;
    max-width: 92%;
    margin: 0 auto 16px;
}
.tc-simulator-wrap .tc-sim-caption {
    margin-bottom: 20px;
    max-width: 90%;
}
.tc-simulator-wrap .tc-sim-premium-badge {
    text-align: center;
    margin-bottom: 15px;
}
.tc-simulator-wrap .tc-sim-fullwidth {
    width: 100%;
}
.tc-simulator-wrap .tc-sim-overflow-x {
    overflow-x: auto;
}
.tc-simulator-wrap .tc-sim-check {
    margin-top: 10px;
    font-size: 12px;
    color: #e2ebe5;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .tc-simulator-wrap .container {
        padding: 10px;
    }
    .tc-simulator-wrap .header {
        flex-direction: column;
        gap: 10px;
    }
    .tc-simulator-wrap .tabs {
        font-size: 14px;
    }
    .tc-simulator-wrap .tab {
        padding: 10px 8px;
        font-size: 14px;
    }
    .tc-simulator-wrap button {
        font-size: 14px;
        padding: 8px 16px;
    }
    .tc-simulator-wrap .results {
        padding: 15px;
        font-size: 14px;
    }
    .tc-simulator-wrap .result-row {
        font-size: 14px;
    }
    .tc-simulator-wrap .gain {
        font-size: 18px;
    }
    .tc-simulator-wrap .tc-sim-hero__brand {
        font-size: 44px;
    }
    .tc-simulator-wrap .tc-sim-hero__emoji {
        font-size: 36px;
    }
    .tc-simulator-wrap .tc-sim-h2 {
        font-size: 18px;
    }
    .tc-simulator-wrap .tc-sim-h2--sub {
        font-size: 15px;
    }
}
