/**
 * Dutching Calculator - Page-Specific Styles
 * Uses base styles from tools-calculators.css
 * @version 1.0.0
 */

/* CSS Variables - Standard green/blue/purple theme */
.dutching-calculator-page {
    --pf-primary: #00ff88;
    --pf-electric: #00bfff;
    --pf-accent: #8b5cf6;
    --pf-success: #22c55e;
    --pf-danger: #ef4444;
    --tools-border: rgba(255, 255, 255, 0.08);
    --tools-muted: rgba(255, 255, 255, 0.65);
    --tools-text: #f8fafc;
    --tools-danger: #f87171;
    padding: 1.5rem 0 2rem;
}

/* ============================================================================
   HEADER - Consistent with other calculators
   ============================================================================ */
.dutching-calculator-page .calculator-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid var(--tools-border);
}

.dutching-calculator-page .calculator-title {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: clamp(1.8rem, 4vw, 2.75rem);
    font-weight: 900;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--pf-primary) 0%, var(--pf-electric) 50%, var(--pf-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.75rem;
    letter-spacing: -0.02em;
}

.dutching-calculator-page .calculator-subtitle {
    font-size: 1.1rem;
    color: var(--tools-muted);
    margin: 0 auto;
    line-height: 1.5;
    text-align: center;
    max-width: 650px;
}

/* ============================================================================
   ACCENT OVERRIDES
   ============================================================================ */
.dutching-calculator-page .bet-label {
    color: var(--pf-primary, #00ff88);
}

.dutching-calculator-page .format-btn.active {
    background: var(--pf-primary, #00ff88);
    border-color: var(--pf-primary, #00ff88);
    color: #000;
}

.dutching-calculator-page .format-btn:hover {
    border-color: var(--pf-primary, #00ff88);
}

.dutching-calculator-page .bet-input-group input:focus {
    border-color: var(--pf-primary, #00ff88);
}

.dutching-calculator-page .calculate-btn {
    background: linear-gradient(135deg, var(--pf-primary, #00ff88), var(--pf-electric, #00bfff));
}

.dutching-calculator-page .calculate-btn:hover {
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

/* ============================================================================
   CALCULATOR FORM
   ============================================================================ */
.dutching-calculator-form {
    margin-top: 1.5rem;
}

.stake-row {
    margin-bottom: 1rem;
}

.stake-row .bet-inputs {
    max-width: 300px;
}

/* Selection Stats (inline below inputs) */
.selection-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--tools-border);
    flex-wrap: wrap;
}

.selection-stats .stat-item {
    font-size: 0.8125rem;
    color: var(--text-secondary, #94a3b8);
}

.selection-stats .stat-item span:last-child {
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-left: 0.25rem;
}

/* Add Selection Button */
.add-selection-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    margin: 1rem 0;
    background: transparent;
    border: 2px dashed var(--tools-border);
    border-radius: 8px;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-selection-btn:hover:not(:disabled) {
    border-color: var(--pf-primary, #00ff88);
    color: var(--pf-primary, #00ff88);
    background: rgba(0, 255, 136, 0.05);
}

.add-selection-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
   RESULTS SECTION
   ============================================================================ */
.dutching-results-container {
    display: none;
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 3px solid var(--border-subtle, #333);
    animation: fadeInUp 0.4s ease;
}

.dutching-results-container.visible {
    display: block;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.results-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary, #ffffff);
    margin: 0;
}

/* ============================================================================
   MAIN RESULT
   ============================================================================ */
.dutching-main-result {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card, #1a1f2e);
    border: 3px solid var(--border-color, #2d3548);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.dutching-main-result.profitable {
    border-color: var(--pf-success, #22c55e);
    background: linear-gradient(135deg, var(--bg-card, #1a1f2e), rgba(34, 197, 94, 0.1));
}

.dutching-main-result.unprofitable {
    border-color: var(--pf-danger, #ef4444);
    background: linear-gradient(135deg, var(--bg-card, #1a1f2e), rgba(239, 68, 68, 0.1));
}

.result-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.result-badge.profitable {
    background: var(--pf-success, #22c55e);
    color: #000;
}

.result-badge.unprofitable {
    background: var(--pf-danger, #ef4444);
    color: #fff;
}

.result-amount {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.dutching-main-result.profitable .result-amount {
    color: var(--pf-success, #22c55e);
}

.dutching-main-result.unprofitable .result-amount {
    color: var(--pf-danger, #ef4444);
}

.result-label {
    font-size: 0.9375rem;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================================
   STATS GRID
   ============================================================================ */
.dutching-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dutching-stat-card {
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 8px;
    padding: 1.25rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.dutching-stat-card:hover {
    border-color: var(--pf-primary, #00ff88);
}

.dutching-stat-card .stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.5rem;
}

.dutching-stat-card .stat-value {
    font-family: 'SF Mono', 'Roboto Mono', monospace;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary, #ffffff);
}

.dutching-stat-card .stat-value.positive {
    color: var(--pf-success, #22c55e);
}

.dutching-stat-card .stat-value.negative {
    color: var(--pf-danger, #ef4444);
}

/* ============================================================================
   STAKE DISTRIBUTION TABLE
   ============================================================================ */
.stake-distribution {
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.distribution-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary, #94a3b8);
    margin: 0 0 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.distribution-table-wrapper {
    overflow-x: auto;
}

.distribution-table {
    width: 100%;
    border-collapse: collapse;
}

.distribution-table th,
.distribution-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--tools-border);
}

.distribution-table th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #64748b);
    background: rgba(0, 0, 0, 0.2);
}

.distribution-table td {
    font-size: 0.9375rem;
    color: var(--text-primary, #fff);
}

.distribution-table .stake-cell {
    font-weight: 700;
    color: var(--pf-primary, #00ff88);
}

.distribution-table .totals-row {
    background: rgba(0, 255, 136, 0.05);
    border-top: 2px solid var(--pf-primary, #00ff88);
}

.distribution-table .totals-row td {
    font-weight: 700;
}

.selection-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* ============================================================================
   STAKE VISUALIZATION
   ============================================================================ */
.stake-visualization {
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 10px;
    padding: 1.5rem;
}

.visualization-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary, #94a3b8);
    margin: 0 0 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stake-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stake-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bar-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.bar-name {
    flex: 1;
    color: var(--text-primary, #fff);
    font-weight: 500;
}

.bar-stake {
    font-family: 'SF Mono', 'Roboto Mono', monospace;
    font-size: 0.8125rem;
    color: var(--text-secondary, #94a3b8);
}

.bar-track {
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
    .dutching-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .selection-stats {
        flex-direction: column;
        gap: 0.5rem;
    }

    .distribution-table th,
    .distribution-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8125rem;
    }

    .result-amount {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .dutching-stats-grid {
        grid-template-columns: 1fr;
    }

    .bar-label {
        flex-wrap: wrap;
    }

    .bar-stake {
        width: 100%;
        margin-left: 1.5rem;
    }
}
