/* Martingale System Simulator Styles */

.martingale-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 {
    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);
}

.danger-section {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

/* 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: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-primary, #3b82f6);
}

.helper-text {
    font-size: 0.875rem;
    color: var(--text-tertiary, #64748b);
    margin-top: var(--space-xs, 0.25rem);
}

/* Preset Buttons */
.preset-buttons {
    display: flex;
    gap: var(--space-sm, 0.5rem);
    flex-wrap: wrap;
    margin-bottom: var(--space-lg, 1.5rem);
}

.preset-btn {
    padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 4px;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    border-color: var(--accent-primary, #3b82f6);
    color: var(--text-primary, #ffffff);
    transform: translateY(-1px);
}

.preset-btn.active {
    background: var(--accent-primary, #3b82f6);
    border-color: var(--accent-primary, #3b82f6);
    color: white;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    padding: var(--space-lg, 1.5rem);
    background: linear-gradient(135deg, var(--accent-primary, #3b82f6), var(--accent-secondary, #8b5cf6));
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    margin-top: var(--space-lg, 1.5rem);
    margin-bottom: var(--space-xl, 2rem);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.calculate-btn:active {
    transform: translateY(0);
}

/* Results Grid */
.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 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: rgba(59, 130, 246, 0.1);
}

.result-card.danger {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

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

.result-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary, #ffffff);
    margin-bottom: var(--space-xs, 0.25rem);
}

.result-subtext {
    font-size: 0.875rem;
    color: var(--text-tertiary, #64748b);
}

/* Warning & Progress Boxes */
.warning-box,
.progress-box {
    background: rgba(234, 179, 8, 0.1);
    border: 2px solid #eab308;
    border-radius: 4px;
    padding: var(--space-lg, 1.5rem);
    margin-top: var(--space-lg, 1.5rem);
    color: var(--text-primary, #ffffff);
}

.progress-box {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-primary, #3b82f6);
    text-align: center;
}

/* 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);
}

.formula-box ul {
    list-style-position: inside;
    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-weight: 700;
}

/* 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 {
    color: var(--accent-primary, #3b82f6);
    margin-bottom: var(--space-md, 1rem);
    font-size: 1.25rem;
}

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

/* Math Box */
.math-box {
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--accent-secondary, #8b5cf6);
    border-radius: 4px;
    padding: var(--space-xl, 2rem);
}

.math-box h3 {
    color: var(--accent-secondary, #8b5cf6);
    margin: var(--space-lg, 1.5rem) 0 var(--space-md, 1rem);
}

.math-box h3:first-child {
    margin-top: 0;
}

.math-box p {
    color: var(--text-secondary, #94a3b8);
    line-height: 1.8;
    font-family: 'Courier New', monospace;
}

.math-box .example {
    color: var(--text-tertiary, #64748b);
    font-style: italic;
}

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

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

.interpretation-box ul {
    list-style-position: inside;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: var(--space-md, 1rem);
}

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

.example-box {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--accent-primary, #3b82f6);
    padding: var(--space-lg, 1.5rem);
    margin-top: var(--space-lg, 1.5rem);
}

.example-box h4 {
    color: var(--accent-primary, #3b82f6);
    margin-bottom: var(--space-md, 1rem);
}

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

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

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

.alternative-card h4 {
    color: #28a745;
    margin-bottom: var(--space-md, 1rem);
}

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

/* Bet Sequence Visualization */
.bet-sequence {
    margin-top: var(--space-2xl, 2.5rem);
    padding-top: var(--space-2xl, 2.5rem);
    border-top: 2px solid var(--border-color, #2d3548);
}

.bet-sequence h3 {
    color: var(--text-primary, #ffffff);
    margin-bottom: var(--space-sm, 0.5rem);
    font-size: 1.5rem;
}

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

.sequence-wrapper {
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 4px;
    padding: var(--space-xl, 2rem);
    margin-bottom: var(--space-md, 1rem);
}

.sequence-display {
    display: flex;
    align-items: center;
    gap: var(--space-sm, 0.5rem);
    overflow-x: auto;
    padding: var(--space-md, 1rem) 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary, #3b82f6) var(--bg-surface, #232838);
}

.sequence-display::-webkit-scrollbar {
    height: 10px;
}

.sequence-display::-webkit-scrollbar-track {
    background: var(--bg-surface, #232838);
    border-radius: 4px;
}

.sequence-display::-webkit-scrollbar-thumb {
    background: var(--accent-primary, #3b82f6);
    border-radius: 4px;
}

.sequence-display::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

.sequence-note {
    color: var(--text-tertiary, #64748b);
    font-size: 0.875rem;
    font-style: italic;
    text-align: center;
}

.bet-card {
    min-width: 160px;
    background: var(--bg-surface, #232838);
    border: 3px solid var(--border-color, #2d3548);
    border-radius: 6px;
    padding: var(--space-lg, 1.5rem);
    text-align: center;
    transition: all 0.2s;
    flex-shrink: 0;
    position: relative;
}

.bet-card:hover {
    border-color: var(--accent-primary, #3b82f6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.bet-card.last-bet {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.15);
    box-shadow: 0 0 20px rgba(220, 53, 69, 0.4);
}

.bet-card.last-bet:hover {
    border-color: #dc3545;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.5);
}

.bet-loss-icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-xs, 0.25rem);
}

.bet-number {
    font-size: 0.75rem;
    color: var(--text-tertiary, #64748b);
    margin-bottom: var(--space-sm, 0.5rem);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.bet-amount {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--text-primary, #ffffff);
    margin-bottom: var(--space-sm, 0.5rem);
}

.bet-total {
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
    padding-top: var(--space-sm, 0.5rem);
    border-top: 1px solid var(--border-color, #2d3548);
}

/* Bet Arrow */
.bet-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    flex-shrink: 0;
}

.arrow-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary, #3b82f6), var(--accent-secondary, #8b5cf6));
    position: relative;
    margin-bottom: var(--space-xs, 0.25rem);
}

.arrow-line::after {
    content: '';
    position: absolute;
    right: -8px;
    top: -5px;
    width: 0;
    height: 0;
    border-left: 10px solid var(--accent-secondary, #8b5cf6);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.arrow-text {
    font-size: 0.75rem;
    color: var(--accent-primary, #3b82f6);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Reality Check Section */
.reality-check {
    margin-top: var(--space-2xl, 2.5rem);
    padding: var(--space-xl, 2rem);
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 4px;
}

.reality-check h3 {
    color: var(--text-primary, #ffffff);
    margin-bottom: var(--space-lg, 1.5rem);
    font-size: 1.5rem;
}

.reality-message {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg, 1.5rem);
}

.reality-item {
    padding: var(--space-lg, 1.5rem);
    background: var(--bg-surface, #232838);
    border-left: 4px solid var(--accent-primary, #3b82f6);
    border-radius: 4px;
    line-height: 1.6;
    color: var(--text-secondary, #94a3b8);
}

.reality-item strong {
    color: var(--text-primary, #ffffff);
    display: block;
    margin-bottom: var(--space-sm, 0.5rem);
    font-size: 1.1rem;
}

.reality-item.warning {
    border-left-color: #eab308;
    background: rgba(234, 179, 8, 0.05);
}

.reality-item.final {
    border-left-color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

/* Result Cards Enhancement */
.result-card.highlight {
    border-color: var(--accent-primary, #3b82f6);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

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

    .preset-buttons {
        flex-direction: column;
    }

    .preset-btn {
        width: 100%;
    }

    .results-container {
        grid-template-columns: 1fr;
    }

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

    .sequence-wrapper {
        padding: var(--space-md, 1rem);
    }

    .sequence-display {
        padding: var(--space-sm, 0.5rem) 0;
    }

    .bet-card {
        min-width: 140px;
        padding: var(--space-md, 1rem);
    }

    .bet-amount {
        font-size: 1.5rem;
    }

    .bet-arrow {
        min-width: 60px;
    }

    .arrow-line {
        width: 40px;
    }

    .arrow-text {
        font-size: 0.65rem;
    }
}
