/* Unit Calculator - Professional Styling */
/* Base styles are in calculator-base.css */

/* CSS Variables */
.unit-calculator-page {
    --pf-primary: #00ff88;
    --pf-electric: #00bfff;
    --pf-accent: #8b5cf6;
    --tools-border: rgba(255, 255, 255, 0.08);
    --tools-muted: rgba(255, 255, 255, 0.65);
    --tools-text: #f8fafc;
    --tools-danger: #f87171;
    padding: var(--space-lg, 1.5rem) 0;
}

/* Title Styling - Matching Homepage Gradient */
.unit-calculator-page .calculator-title {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: clamp(1.8rem, 4vw, 3rem);
    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-bottom: var(--space-lg, 1.5rem);
    letter-spacing: -0.02em;
}

/* Input Shake Animation */
@keyframes shakeInput {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake-error {
    animation: shakeInput 0.5s ease-in-out;
}

/* ============================================================================
   ERROR DISPLAY - Field-level validation errors
   ============================================================================ */
.field-error {
    display: none;
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.375rem;
    font-weight: 500;
}

.field-error.show {
    display: block !important;
}

.input-error {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* ============================================================================
   CONSTRAINT INFO - Shows input limits
   ============================================================================ */
.constraint-info {
    text-align: center;
    margin-top: 0.75rem;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.875rem;
}

.optional-label {
    color: var(--text-tertiary, #64748b);
    font-size: 0.8125rem;
    font-weight: 400;
}

/* ============================================================================
   RESULTS DISPLAY - Single Row Layout
   ============================================================================ */
.results-summary {
    display: flex;
    align-items: stretch;
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: var(--space-xl, 2rem);
}

.result-item {
    flex: 1;
    padding: 1.5rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.result-item.primary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.1) 100%);
}

.result-divider {
    width: 2px;
    background: var(--border-color, #2d3548);
    flex-shrink: 0;
}

.result-item .result-label {
    font-size: 0.9375rem;
    color: var(--text-secondary, #94a3b8);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-item .result-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary, #e2e8f0);
    line-height: 1.2;
}

.result-item .result-value.highlight {
    color: #10b981;
}

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

/* ============================================================================
   BET DETAILS GRID - Shows bet specifics
   ============================================================================ */
.bet-details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: var(--space-xl, 2rem);
}

.detail-card {
    background: var(--bg-card, #1a1f2e);
    border: 1px solid var(--border-color, #2d3548);
    border-radius: 6px;
    padding: 1.25rem;
    text-align: center;
}

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

.detail-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #e2e8f0);
}

.detail-value.positive {
    color: #22c55e;
}

.detail-value.negative {
    color: #ef4444;
}

/* ============================================================================
   STATS GRID - Performance metrics
   ============================================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: var(--space-xl, 2rem);
}

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

.stat-card:hover {
    border-color: var(--accent-primary, #3b82f6);
    transform: translateY(-2px);
}

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

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary, #e2e8f0);
}

.stat-value.success {
    color: #22c55e;
}

.stat-value.warning {
    color: #fbbf24;
}

/* ============================================================================
   BET HISTORY SECTION
   ============================================================================ */
.bet-history-section {
    margin-top: var(--space-xl, 2rem);
}

.bet-history-section h3 {
    font-size: 1.125rem;
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 1rem;
    font-weight: 600;
}

.bet-history {
    margin-top: var(--space-md, 1rem);
}

.bet-history table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 8px;
    overflow: hidden;
}

.bet-history th,
.bet-history td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color, #2d3548);
}

.bet-history th {
    background: var(--bg-surface, #232838);
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    font-size: 0.9375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bet-history td {
    color: var(--text-secondary, #94a3b8);
    font-size: 1rem;
}

.bet-history tr:last-child td {
    border-bottom: none;
}

.bet-history tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.bet-history .bet-desc {
    color: var(--text-primary, #e2e8f0);
    font-weight: 600;
}

.bet-history .positive {
    color: #22c55e;
    font-weight: 600;
}

.bet-history .negative {
    color: #ef4444;
    font-weight: 600;
}

/* Empty state */
.no-bets-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-tertiary, #64748b);
    font-size: 1rem;
}

/* Remove button in table */
.bet-history .remove-bet-btn {
    width: 28px;
    height: 28px;
    background: #dc3545;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.bet-history .remove-bet-btn:hover {
    transform: scale(1.1);
    background: #c82333;
}

/* ============================================================================
   CONFIRMATION DIALOG
   ============================================================================ */
.confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.confirmation-dialog {
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.2s ease-out;
}

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

.confirmation-dialog h3 {
    color: var(--text-primary, #e2e8f0);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.confirmation-dialog p {
    color: var(--text-secondary, #94a3b8);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.confirmation-actions {
    display: flex;
    gap: 1rem;
}

.confirmation-actions button {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.confirm-danger-btn {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.confirm-danger-btn:hover {
    background: #c82333;
    border-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.confirm-cancel-btn {
    background: transparent;
    color: var(--text-primary, #e2e8f0);
    border-color: var(--border-color, #2d3548);
}

.confirm-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-primary, #3b82f6);
    transform: translateY(-2px);
}

/* ============================================================================
   BET TRACKING SECTION
   ============================================================================ */
.bet-tracking-section {
    margin-top: var(--space-xl, 2rem);
}

.bet-tracking-section h3 {
    font-size: 1.125rem;
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 1rem;
    font-weight: 600;
}

.bet-tracking-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md, 1rem);
    margin-bottom: var(--space-lg, 1.5rem);
}

.bet-tracking-actions {
    display: flex;
    gap: var(--space-md, 1rem);
    margin-bottom: var(--space-xl, 2rem);
}

.add-bet-btn,
.clear-bets-btn {
    flex: 1;
    padding: var(--space-md, 1rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 48px;
    border-radius: 4px;
    font-size: 1.125rem;
}

.add-bet-btn {
    background: var(--accent-primary, #3b82f6);
    border: 2px solid var(--accent-primary, #3b82f6);
    color: white;
}

.add-bet-btn:hover {
    background: var(--accent-secondary, #2563eb);
    border-color: var(--accent-secondary, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.clear-bets-btn {
    background: transparent;
    border: 2px solid #ef4444;
    color: #ef4444;
}

.clear-bets-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    transform: translateY(-2px);
}

/* ============================================================================
   RISK INDICATOR INFO BOXES
   ============================================================================ */
.info-box.risk-extreme {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2) 0%, rgba(185, 28, 28, 0.15) 100%);
    border-color: rgba(220, 38, 38, 0.6);
}

.info-box.risk-high {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.15) 100%);
    border-color: rgba(251, 191, 36, 0.6);
}

.info-box.risk-moderate {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.15) 100%);
    border-color: rgba(59, 130, 246, 0.6);
}

.info-box.risk-reasonable {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(22, 163, 74, 0.15) 100%);
    border-color: rgba(34, 197, 94, 0.6);
}

/* ============================================================================
   CLEANER, PROFESSIONAL INFO SECTIONS
   ============================================================================ */

/* Override flashy base styles with cleaner professional look */
.unit-calculator-page .calculator-section h2,
.unit-calculator-page .info-section h2 {
    font-size: 1.75rem;
    color: var(--text-primary, #e2e8f0);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.unit-calculator-page .info-section {
    background: var(--bg-surface, #232838);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.unit-calculator-page .info-section p {
    font-size: 1.0625rem;
    line-height: 1.7;
}

.unit-calculator-page .info-section h2 {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Cleaner formula box */
.unit-calculator-page .formula-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 1.5rem;
    margin-top: 1.25rem;
}

.unit-calculator-page .formula-box h3 {
    color: var(--text-primary, #e2e8f0);
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.875rem;
}

.unit-calculator-page .formula-box p {
    font-size: 1rem;
    line-height: 1.7;
}

.unit-calculator-page .formula-box .example {
    color: var(--text-tertiary, #64748b);
    font-size: 0.9375rem;
    font-family: 'Courier New', monospace;
    margin-top: 0.5rem;
}

/* Info cards grid */
.unit-calculator-page .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.25rem;
}

.unit-calculator-page .info-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 1.5rem;
    transition: all 0.2s;
}

.unit-calculator-page .info-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(59, 130, 246, 0.3);
}

.unit-calculator-page .info-card h3 {
    color: var(--text-primary, #e2e8f0);
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.unit-calculator-page .info-card p {
    color: var(--text-secondary, #94a3b8);
    font-size: 1rem;
    line-height: 1.7;
}

/* Tips grid */
.unit-calculator-page .tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.25rem;
}

.unit-calculator-page .tip-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 1.5rem;
    transition: all 0.2s;
}

.unit-calculator-page .tip-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(59, 130, 246, 0.3);
}

.unit-calculator-page .tip-card h4 {
    color: var(--text-primary, #e2e8f0);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.unit-calculator-page .tip-card p {
    font-size: 1rem;
    line-height: 1.7;
}

/* Strategy boxes */
.unit-calculator-page .strategy {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.unit-calculator-page .strategy.conservative {
    border-left: 3px solid rgba(34, 197, 94, 0.6);
}

.unit-calculator-page .strategy.moderate {
    border-left: 3px solid rgba(59, 130, 246, 0.6);
}

.unit-calculator-page .strategy.aggressive {
    border-left: 3px solid rgba(251, 191, 36, 0.6);
}

.unit-calculator-page .strategy h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.875rem;
    color: var(--text-primary, #e2e8f0);
}

.unit-calculator-page .strategy ul {
    margin: 0;
    padding-left: 1.25rem;
}

.unit-calculator-page .strategy li {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .bet-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .bet-tracking-inputs {
        grid-template-columns: 1fr;
    }

    .bet-details-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .bet-tracking-actions {
        flex-direction: column;
    }

    /* Stack results vertically on mobile */
    .results-summary {
        flex-direction: column;
    }

    .result-divider {
        height: 2px;
        width: 100%;
    }

    .result-item .result-value {
        font-size: 1.75rem;
    }

    /* Bet history table responsive */
    .bet-history table {
        font-size: 0.875rem;
    }

    .bet-history th,
    .bet-history td {
        padding: 0.75rem 0.875rem;
    }

    /* Hide less important columns on mobile */
    .bet-history th:nth-child(3),
    .bet-history td:nth-child(3) {
        display: none;
    }
}

@media (max-width: 480px) {
    .result-item .result-value {
        font-size: 1.5rem;
    }

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

    .stat-value {
        font-size: 1.5rem;
    }
}

/* ============================================================================
   FAQ SECTION STYLES
   ============================================================================ */
.unit-calculator-page .faq-section {
    margin-top: 3rem;
}

.unit-calculator-page .faq-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--tools-text);
    margin-bottom: 1.5rem;
}

.unit-calculator-page .faq-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.unit-calculator-page .faq-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--tools-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.unit-calculator-page .faq-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.unit-calculator-page .faq-item[open] {
    background: rgba(255, 255, 255, 0.04);
}

.unit-calculator-page .faq-question {
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--tools-text);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.unit-calculator-page .faq-question::-webkit-details-marker {
    display: none;
}

.unit-calculator-page .faq-question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--tools-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.unit-calculator-page .faq-item[open] .faq-question::after {
    content: '−';
}

.unit-calculator-page .faq-answer {
    padding: 0 1.5rem 1.25rem 1.5rem;
    color: var(--tools-muted);
    line-height: 1.7;
}

.unit-calculator-page .faq-answer p {
    margin: 0;
}

/* ============================================================================
   RELATED TOOLS SECTION
   ============================================================================ */
.unit-calculator-page .related-tools-section {
    margin-top: 3rem;
}

.unit-calculator-page .related-tools-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--tools-text);
    margin-bottom: 1.5rem;
}

.unit-calculator-page .related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.unit-calculator-page .related-tool-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--tools-border);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.unit-calculator-page .related-tool-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--pf-electric);
    transform: translateY(-2px);
}

.unit-calculator-page .related-tool-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 191, 255, 0.1));
    border-radius: 10px;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.unit-calculator-page .related-tool-content {
    flex: 1;
    min-width: 0;
}

.unit-calculator-page .related-tool-name {
    font-weight: 600;
    color: var(--tools-text);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.unit-calculator-page .related-tool-desc {
    font-size: 0.875rem;
    color: var(--tools-muted);
    line-height: 1.4;
}
