/* ==========================================================================
   Workbook Page – Tool & Calculator Styles
   Extends bonus.css with interactive tool components
   ========================================================================== */

/* Tool Card (wrapper for interactive content like calculators, tables) */
.wb-tool-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 51, 102, 0.08);
    border: 1px solid rgba(0, 51, 102, 0.06);
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.wb-tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
}

.wb-tool-title {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wb-tool-title i {
    color: var(--accent);
}

/* Table Wrapper (responsive) */
.wb-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Greeks Reference Table */
.greek-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.greek-table th {
    background: var(--bg-light, #f5f7fa);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 2px solid rgba(0, 51, 102, 0.15);
}

.greek-table td {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(0, 51, 102, 0.08);
    vertical-align: top;
}

.greek-table tr:last-child td {
    border-bottom: none;
}

.greek-name {
    font-weight: 600;
    color: var(--primary);
}

.greek-symbol {
    font-family: 'Times New Roman', serif;
    font-size: 1.1rem;
    color: var(--accent);
    background: var(--primary);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-right: 0.5rem;
}

/* Calculator Styles */
.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.calc-field label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-gray, #555);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.calc-field input,
.calc-field select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid rgba(0, 51, 102, 0.15);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Roboto Mono', monospace;
    background: white;
    transition: border-color 0.2s;
}

.calc-field input:focus,
.calc-field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.calc-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, var(--primary) 0%, #004080 100%);
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 51, 102, 0.25);
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 51, 102, 0.35);
}

.calc-result {
    background: rgba(0, 51, 102, 0.04);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
}

.calc-result .label {
    color: var(--text-gray, #555);
    font-size: 0.8rem;
}

.calc-result .value {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.calc-result .value.profit { color: #16a34a; }
.calc-result .value.loss { color: #dc2626; }

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 51, 102, 0.08);
}

.result-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Formula Box */
.formula-box {
    background: var(--primary);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    margin: 0.75rem 0;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    text-align: center;
}

.formula-box .formula {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 600;
}

/* Info Box */
.info-box {
    background: rgba(255, 215, 0, 0.1);
    border-left: 4px solid var(--accent);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-gray, #555);
    border-radius: 0 12px 12px 0;
    line-height: 1.6;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid rgba(0, 51, 102, 0.1);
    margin-bottom: 1.25rem;
    gap: 0.25rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    color: var(--text-gray, #555);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
    border-radius: 8px 8px 0 0;
}

.tab-btn:hover {
    color: var(--primary);
    background: rgba(0, 51, 102, 0.04);
}

.tab-btn.active {
    color: var(--primary);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

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

    .wb-tool-card {
        padding: 1.5rem;
    }

    .greek-table {
        font-size: 0.8rem;
    }

    .greek-table th,
    .greek-table td {
        padding: 0.5rem;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

@media print {
    .wb-tool-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
