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

/* CSS Variables */
.kelly-criterion-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/Mines Gradient */
.kelly-criterion-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); }
}

.kelly-criterion-calculator-page .shake-error {
    animation: shakeInput 0.5s ease;
}

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

/* ============================================================================
   INPUT STRUCTURE
   ============================================================================ */
.input-row {
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 4px;
    padding: var(--space-lg, 1.5rem);
    margin-bottom: var(--space-lg, 1.5rem);
}

.input-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* ============================================================================
   KELLY FRACTION SELECTOR - Unique to Kelly Calculator
   ============================================================================ */
.kelly-fraction-selector {
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 4px;
    padding: var(--space-lg, 1.5rem);
    margin-bottom: var(--space-lg, 1.5rem);
}

.kelly-fraction-selector > label {
    display: block;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.kelly-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.kelly-btn {
    background: var(--bg-surface, #232838);
    color: var(--text-secondary, #94a3b8);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 6px;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.kelly-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-primary, #3b82f6);
    color: var(--text-primary, #e2e8f0);
    transform: translateY(-1px);
}

.kelly-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.15) 100%);
    border-color: var(--accent-primary, #3b82f6);
    color: var(--accent-primary, #3b82f6);
    font-weight: 700;
}

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

/* ============================================================================
   HELPER TEXT - Information below inputs
   ============================================================================ */
.helper-text {
    font-size: 0.875rem;
    color: var(--text-tertiary, #64748b);
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* ============================================================================
   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.positive {
    color: #22c55e;
}

.result-item .result-value.negative {
    color: #ef4444;
}

.result-item .result-value.neutral {
    color: #94a3b8;
}

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

/* ============================================================================
   WARNING MESSAGE - For no edge or high volatility
   ============================================================================ */
.warning-message {
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: var(--space-xl, 2rem);
    font-size: 0.9375rem;
    line-height: 1.6;
    display: none;
}

.warning-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid #ef4444;
    color: var(--text-primary, #e2e8f0);
}

.warning-message.warning {
    display: block;
    background: rgba(251, 191, 36, 0.1);
    border: 2px solid #fbbf24;
    color: var(--text-primary, #e2e8f0);
}

.warning-message strong {
    color: inherit;
    font-weight: 700;
}

/* ============================================================================
   COMPARISON TABLE - Unique to Kelly Calculator
   ============================================================================ */
.comparison-section {
    background: var(--bg-card, #1a1f2e);
    border: 2px solid var(--border-color, #2d3548);
    border-radius: 8px;
    padding: var(--space-xl, 2rem);
    margin-bottom: var(--space-xl, 2rem);
}

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

.comparison-table {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.comparison-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 1rem;
    background: var(--bg-surface, #232838);
    border: 1px solid var(--border-color, #2d3548);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    transition: all 0.2s;
    align-items: center;
}

.comparison-row:hover {
    border-color: var(--accent-primary, #3b82f6);
    transform: translateX(2px);
}

.comparison-row.active-row {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.1) 100%);
    border-color: var(--accent-primary, #3b82f6);
    border-width: 2px;
}

.comparison-row.header-row {
    background: rgba(255, 255, 255, 0.02);
    border: none;
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1.25rem;
}

.comparison-row.header-row:hover {
    transform: none;
}

.comparison-cell {
    text-align: left;
}

.comparison-cell:first-child {
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
}

.comparison-cell:not(:first-child) {
    text-align: center;
    color: var(--text-secondary, #94a3b8);
}

.comparison-row.active-row .comparison-cell:first-child {
    color: var(--accent-primary, #3b82f6);
}

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

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

.kelly-criterion-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;
}

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

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

/* Cleaner formula box */
.kelly-criterion-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;
}

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

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

.kelly-criterion-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 */
.kelly-criterion-calculator-page .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.25rem;
}

.kelly-criterion-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;
}

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

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

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

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

.kelly-criterion-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;
}

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

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

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

/* Responsive Design */
@media (max-width: 768px) {
    /* Stack Kelly fraction buttons vertically on mobile */
    .kelly-buttons {
        grid-template-columns: 1fr 1fr;
    }

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

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

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

    /* Simplify comparison table on mobile */
    .comparison-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .comparison-row.header-row {
        display: none;
    }

    .comparison-cell {
        text-align: left !important;
        display: flex;
        justify-content: space-between;
    }

    .comparison-cell::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary, #94a3b8);
        font-size: 0.8125rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .comparison-cell:first-child::before {
        content: 'Method: ';
    }
}

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

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

    .comparison-section {
        padding: var(--space-lg, 1.5rem);
    }

    .kelly-criterion-calculator-page .calculator-title {
        font-size: 1.6rem;
    }
}

/* ============================================================================
   FAQ SECTION
   ============================================================================ */
.kelly-criterion-calculator-page .faq-section {
    margin-top: 4rem;
}

.kelly-criterion-calculator-page .faq-section .section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.kelly-criterion-calculator-page .faq-section .section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--tools-text);
    margin: 0;
}

/* FAQ Accordion */
.kelly-criterion-calculator-page .pf-accordion {
    max-width: 900px;
    margin: 0 auto;
}

.kelly-criterion-calculator-page .pf-accordion-item {
    border-bottom: 1px solid var(--tools-border);
}

.kelly-criterion-calculator-page .pf-accordion-item:first-child {
    border-top: 1px solid var(--tools-border);
}

.kelly-criterion-calculator-page .pf-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: all 0.2s ease;
}

.kelly-criterion-calculator-page .pf-accordion-summary::-webkit-details-marker {
    display: none;
}

.kelly-criterion-calculator-page .pf-accordion-summary:hover {
    color: var(--pf-primary);
}

.kelly-criterion-calculator-page .pf-accordion-summary:hover .pf-accordion-icon {
    stroke: var(--pf-primary);
}

.kelly-criterion-calculator-page .pf-accordion-question {
    flex: 1;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--tools-text);
    line-height: 1.4;
}

.kelly-criterion-calculator-page .pf-accordion-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    stroke: var(--tools-muted);
    transition: all 0.3s ease;
}

.kelly-criterion-calculator-page .pf-accordion-item[open] .pf-accordion-icon {
    transform: rotate(45deg);
}

.kelly-criterion-calculator-page .pf-accordion-item[open] .pf-accordion-icon-horizontal {
    opacity: 0;
}

.kelly-criterion-calculator-page .pf-accordion-content {
    padding: 0 0 1.5rem 0;
    color: var(--tools-muted);
    line-height: 1.7;
}

.kelly-criterion-calculator-page .pf-accordion-content p {
    margin: 0 0 1rem;
    font-size: 1rem;
}

.kelly-criterion-calculator-page .pf-accordion-content p:last-child {
    margin-bottom: 0;
}

.kelly-criterion-calculator-page .pf-accordion-content a {
    color: var(--pf-primary);
    text-decoration: none;
}

.kelly-criterion-calculator-page .pf-accordion-content a:hover {
    text-decoration: underline;
}

.kelly-criterion-calculator-page .pf-accordion-content code {
    background: rgba(0, 255, 136, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9em;
    color: var(--pf-primary);
}

/* ============================================================================
   RELATED TOOLS SECTION
   ============================================================================ */
.kelly-criterion-calculator-page .related-tools-section {
    margin-top: 4rem;
    padding: 3rem 0;
}

.kelly-criterion-calculator-page .related-tools-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.kelly-criterion-calculator-page .related-tools-header h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 800;
    color: var(--tools-text);
    margin: 0 0 0.75rem;
}

.kelly-criterion-calculator-page .related-tools-header p {
    color: var(--tools-muted);
    font-size: 1.05rem;
    margin: 0;
}

.kelly-criterion-calculator-page .related-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.kelly-criterion-calculator-page .related-tool-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: linear-gradient(145deg, rgba(13, 17, 26, 0.8) 0%, rgba(15, 21, 32, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.5rem 1.75rem;
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.kelly-criterion-calculator-page .related-tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--pf-primary) 0%, var(--pf-electric) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kelly-criterion-calculator-page .related-tool-card:hover {
    background: linear-gradient(145deg, rgba(13, 17, 26, 1) 0%, rgba(15, 21, 32, 1) 100%);
    border-color: rgba(56, 189, 248, 0.25);
    transform: translateX(6px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.kelly-criterion-calculator-page .related-tool-card:hover::before {
    opacity: 1;
}

.kelly-criterion-calculator-page .tool-card-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 191, 255, 0.1) 100%);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.kelly-criterion-calculator-page .tool-card-icon svg {
    stroke: var(--pf-primary);
    transition: all 0.3s ease;
}

.kelly-criterion-calculator-page .related-tool-card:hover .tool-card-icon {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 191, 255, 0.2) 100%);
    border-color: rgba(0, 255, 136, 0.4);
    transform: scale(1.05);
}

.kelly-criterion-calculator-page .related-tool-card:hover .tool-card-icon svg {
    stroke: var(--pf-electric);
}

.kelly-criterion-calculator-page .tool-card-content {
    flex: 1;
    min-width: 0;
}

.kelly-criterion-calculator-page .tool-card-content h3 {
    color: var(--tools-text);
    margin: 0 0 0.4rem;
    font-size: 1.1rem;
    font-weight: 700;
    transition: color 0.3s ease;
}

.kelly-criterion-calculator-page .related-tool-card:hover .tool-card-content h3 {
    color: var(--pf-primary);
}

.kelly-criterion-calculator-page .tool-card-content p {
    color: var(--tools-muted);
    font-size: 0.92rem;
    margin: 0;
    line-height: 1.5;
    opacity: 0.85;
}

.kelly-criterion-calculator-page .tool-card-arrow {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.kelly-criterion-calculator-page .tool-card-arrow svg {
    stroke: var(--tools-muted);
    transition: all 0.3s ease;
    opacity: 0.5;
}

.kelly-criterion-calculator-page .related-tool-card:hover .tool-card-arrow {
    background: rgba(0, 255, 136, 0.15);
    transform: translateX(4px);
}

.kelly-criterion-calculator-page .related-tool-card:hover .tool-card-arrow svg {
    stroke: var(--pf-primary);
    opacity: 1;
}

/* Mobile Responsive for FAQ and Related Tools */
@media (max-width: 768px) {
    .kelly-criterion-calculator-page .related-tools-grid {
        grid-template-columns: 1fr;
    }

    .kelly-criterion-calculator-page .related-tool-card {
        padding: 1.25rem 1.5rem;
    }

    .kelly-criterion-calculator-page .tool-card-icon {
        width: 46px;
        height: 46px;
    }

    .kelly-criterion-calculator-page .tool-card-icon svg {
        width: 24px;
        height: 24px;
    }

    .kelly-criterion-calculator-page .tool-card-arrow {
        display: none;
    }

    .kelly-criterion-calculator-page .pf-accordion-question {
        font-size: 1rem;
    }
}
