/* Losing Streak Calculator Styles */

.streak-calculator-page {
    padding: var(--space-lg, 1.5rem) 0;
}

/* Header */
.calculator-header {
    text-align: center;
    margin-bottom: var(--space-2xl, 2.5rem);
    padding-bottom: var(--space-xl, 2rem);
    border-bottom: 3px solid var(--border-color, #2d3548);
}

.calculator-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    color: var(--text-primary, #ffffff);
    margin-bottom: var(--space-sm, 0.5rem);
}

.calculator-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary, #94a3b8);
}

/* Sections */
.calculator-section,
.info-section,
.table-section {
    background: var(--bg-surface, #232838);
    border: 3px solid var(--border-color, #2d3548);
    border-radius: 4px;
    padding: var(--space-2xl, 2.5rem);
    margin-bottom: var(--space-2xl, 2.5rem);
}

.section-description {
    color: var(--text-secondary, #94a3b8);
    margin-bottom: var(--space-lg, 1.5rem);
}

/* Formula Box */
.formula-box {
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--accent-primary, #3b82f6);
    border-radius: 4px;
    padding: var(--space-xl, 2rem);
    margin-top: var(--space-lg, 1.5rem);
}

.formula-box h3 {
    color: var(--accent-primary, #3b82f6);
    margin-bottom: var(--space-md, 1rem);
    font-size: 1.25rem;
}

.formula-box p {
    margin-bottom: var(--space-sm, 0.5rem);
    color: var(--text-secondary, #94a3b8);
}

.formula-box .example {
    margin-top: var(--space-md, 1rem);
    padding-top: var(--space-md, 1rem);
    border-top: 1px solid var(--border-color, #2d3548);
    font-style: italic;
}

/* Calculator Grid */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg, 1.5rem);
    margin-bottom: var(--space-xl, 2rem);
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    margin-bottom: var(--space-sm, 0.5rem);
    display: flex;
    align-items: center;
    gap: var(--space-xs, 0.25rem);
}

.tooltip {
    cursor: help;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.875rem;
}

.input-group input {
    padding: var(--space-md, 1rem);
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 4px;
    color: var(--text-primary, #ffffff);
    font-size: 1rem;
    transition: all 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.helper-text {
    font-size: 0.875rem;
    color: var(--text-secondary, #94a3b8);
    margin-top: var(--space-xs, 0.25rem);
}

/* Buttons */
.calculate-btn,
.secondary-btn {
    padding: var(--space-md, 1rem) var(--space-xl, 2rem);
    background: var(--accent-primary, #3b82f6);
    color: white;
    border: 3px solid var(--accent-primary, #3b82f6);
    border-radius: 4px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}

.calculate-btn:hover,
.secondary-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.calculate-btn:active,
.secondary-btn:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

.secondary-btn {
    background: var(--bg-card, #1a1f2e);
    color: var(--accent-primary, #3b82f6);
}

/* Results Container */
.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg, 1.5rem);
    margin-top: var(--space-xl, 2rem);
}

.result-card {
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 4px;
    padding: var(--space-lg, 1.5rem);
    text-align: center;
}

.result-card.primary {
    border-color: var(--accent-primary, #3b82f6);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, var(--bg-card, #1a1f2e) 100%);
}

.result-label {
    font-size: 0.875rem;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: var(--space-sm, 0.5rem);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.result-value {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--accent-primary, #3b82f6);
    margin-bottom: var(--space-xs, 0.25rem);
    line-height: 1.3;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.result-card.primary .result-value {
    font-size: 2rem;
}

.result-subtext {
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
}

#frequencyResult {
    font-size: 1.35rem;
    font-weight: 700;
    word-break: keep-all;
    white-space: normal;
    overflow-wrap: normal;
    text-align: center;
    display: block;
    width: 100%;
}

#probabilityResult {
    text-decoration: underline dotted;
    text-decoration-color: rgba(59, 130, 246, 0.4);
    text-underline-offset: 4px;
}

/* Warning Box */
.warning-box {
    background: rgba(251, 191, 36, 0.1);
    border: 2px solid #fbbf24;
    border-radius: 4px;
    padding: var(--space-lg, 1.5rem);
    margin-top: var(--space-xl, 2rem);
    color: #fbbf24;
}

.warning-box strong {
    display: block;
    margin-bottom: var(--space-sm, 0.5rem);
}

/* Streak Table */
.table-controls {
    margin-bottom: var(--space-lg, 1.5rem);
}

.table-wrapper {
    overflow-x: auto;
    margin-top: var(--space-lg, 1.5rem);
}

.streak-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.streak-table thead {
    background: var(--bg-card, #1a1f2e);
    position: sticky;
    top: 0;
    z-index: 10;
}

.streak-table th {
    padding: var(--space-md, 1rem);
    text-align: left;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    border-bottom: 2px solid var(--border-color, #2d3548);
}

.streak-table td {
    padding: var(--space-md, 1rem);
    border-bottom: 1px solid var(--border-color, #2d3548);
    color: var(--text-secondary, #94a3b8);
}

.streak-table tbody tr {
    transition: background-color 0.2s;
}

.streak-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* Likelihood Badges */
.likelihood-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.streak-table tr.very-common,
.likelihood-badge.very-common {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
}

.streak-table tr.common,
.likelihood-badge.common {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border-color: #fbbf24;
}

.streak-table tr.uncommon,
.likelihood-badge.uncommon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: #3b82f6;
}

.streak-table tr.rare,
.likelihood-badge.rare {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
    border-color: #a855f7;
}

.streak-table tr.very-rare,
.likelihood-badge.very-rare {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-color: #22c55e;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg, 1.5rem);
    margin-top: var(--space-lg, 1.5rem);
}

.info-card {
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 4px;
    padding: var(--space-lg, 1.5rem);
}

.info-card h3 {
    font-size: 1.125rem;
    color: var(--accent-primary, #3b82f6);
    margin-bottom: var(--space-md, 1rem);
}

.info-card p,
.info-card ul {
    color: var(--text-secondary, #94a3b8);
    line-height: 1.6;
}

.info-card ul {
    padding-left: var(--space-lg, 1.5rem);
}

.info-card li {
    margin-bottom: var(--space-sm, 0.5rem);
}

/* Use Cases */
.use-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg, 1.5rem);
    margin-top: var(--space-lg, 1.5rem);
}

.use-case {
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 4px;
    padding: var(--space-lg, 1.5rem);
}

.use-case h4 {
    font-size: 1rem;
    color: var(--text-primary, #ffffff);
    margin-bottom: var(--space-sm, 0.5rem);
}

.use-case p {
    color: var(--text-secondary, #94a3b8);
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Reverse Calculator */
.reverse-calculator {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.05) 0%, var(--bg-surface, #232838) 100%);
    border-color: rgba(168, 85, 247, 0.3);
}

.reverse-calculator h2 {
    color: #a855f7;
}

/* Responsive */
@media (max-width: 768px) {
    .calculator-grid,
    .results-container {
        grid-template-columns: 1fr;
    }

    .calculator-title {
        font-size: 2rem;
    }

    .result-card.primary .result-value {
        font-size: 1.5rem;
    }

    .result-value {
        font-size: 1.25rem;
    }

    .info-grid,
    .use-cases {
        grid-template-columns: 1fr;
    }

    .streak-table {
        font-size: 0.875rem;
    }

    .streak-table th,
    .streak-table td {
        padding: var(--space-sm, 0.5rem);
    }
}

@media (max-width: 480px) {
    .calculator-section,
    .info-section,
    .table-section {
        padding: var(--space-lg, 1.5rem);
    }

    .calculator-title {
        font-size: 1.5rem;
    }

    .calculator-subtitle {
        font-size: 1rem;
    }
}
