/* ==================== User Guide Tab Styles ==================== */

/* ==================== Guide Tab Bubble Effect ==================== */

/* Guide Tab Bubble Container */
.guide-bubble-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Guide Tab Bubble Indicator */
.guide-anchored-bubble {
    position: absolute;
    position-anchor: --guide-selected;
    top: anchor(center);
    transform: translateY(-50%);
    left: anchor(left);
    width: anchor-size(width);
    height: anchor-size(height);
    border: 2px solid rgba(13, 110, 253, 0.5);
    border-radius: 999px;
    transition: all 1s var(--calc-spring-easing);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    pointer-events: none;
    backdrop-filter: url(#calculator-bubble-filter);
    z-index: 20000;
}

.guide-anchored-bubble::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse, rgba(13, 110, 253, 0.3), transparent);
    border-radius: 999px;
}

/* Ensure nav items work with bubble */
#guideTab .nav-link {
    position: relative;
    z-index: 1;
}

/* Guide Header */
.calc-user-guide-header h2 {
    color: #212529;
    font-weight: 700;
    border-bottom: 3px solid #0d6efd;
    padding-bottom: 0.5rem;
}

.calc-user-guide-header p {
    font-size: 1.1rem;
}

/* Guide Navigation Pills */
#guideTab .nav-link {
    color: #495057;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    background: transparent;
}

#guideTab .nav-link:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
    border-color: #dee2e6;
}

#guideTab .nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#guideTab .nav-link i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

/* Guide Content */
.calc-guide-content {
    padding: 0.5rem 0.5rem;
}

.guide-content {
    padding: 0.5rem;
    column-count: 3;
    column-gap: 1.5rem;
}

.guide-content h3 {
    column-span: all;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.guide-content .lead {
    column-span: all;
}

.calc-guide-content h3,
.guide-content h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 1.3rem;
}

.calc-guide-content h5,
.guide-content h5 {
    color: #495057;
    font-weight: 600;
    margin-top: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.calc-guide-content h6,
.guide-content h6 {
    color: #212529;
    font-weight: 600;
    margin-top: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.calc-guide-content ul,
.calc-guide-content ol,
.guide-content ul,
.guide-content ol {
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.calc-guide-content .lead,
.guide-content .lead {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

/* Each section gets its own column */
.guide-content section {
    margin-bottom: 0.5rem;
    break-before: column;
    break-inside: avoid;
}

.guide-content hr {
    display: none;
}

.guide-content .alert {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    margin-top: 0.25rem;
    break-inside: avoid;
}

.guide-content p {
    margin-bottom: 0.35rem;
}

/* Make Bootstrap rows work with columns */
.guide-content .row {
    display: block !important;
    width: 100% !important;
}

.guide-content .row > [class*="col-"] {
    width: 100% !important;
    padding: 0 !important;
}

/* Allow most content to break across columns - only prevent breaking for specific elements */
.guide-content .alert,
.guide-content .code-block pre {
    break-inside: avoid;
}

/* Parameter Cards */
.calc-parameter-card,
.parameter-card {
    background: #f8f9fa;
    border-left: 4px solid #0d6efd;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    break-inside: avoid;
    page-break-inside: avoid;
}

.calc-parameter-card h6 {
    color: #0d6efd;
    margin-top: 0;
}

/* Code Blocks */
.calc-code-block pre,
.code-block pre {
    font-size: 0.8rem;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
    color: #212529;
    font-family: 'Courier New', monospace;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.calc-code-block code {
    background-color: #e7f1ff;
    color: #0d6efd;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

/* Instruction Lists */
.calc-instruction-list {
    counter-reset: instruction;
    list-style: none;
    padding-left: 0;
}

.calc-instruction-list li {
    counter-increment: instruction;
    margin-bottom: 0.75rem;
    padding-left: 2.5rem;
    position: relative;
}

.calc-instruction-list li::before {
    content: counter(instruction);
    position: absolute;
    left: 0;
    top: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.calc-instruction-list li strong {
    color: #0d6efd;
    display: block;
    margin-bottom: 0.25rem;
}

/* Example Boxes */
.calc-example-box {
    border-left: 4px solid #28a745;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.calc-example-box h6 {
    margin-top: 1rem;
}

/* Calculation Examples */
.calc-calculation-example {
    border-left: 4px solid #17a2b8;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.calc-calculation-example h6 {
    margin-top: 0;
}

/* Strategy Cards */
.calc-strategy-card {
    background: linear-gradient(to bottom right, #ffffff, #f8f9fa);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.calc-strategy-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.calc-strategy-card h6 {
    margin-top: 0;
}

/* Feature Cards */
.calc-feature-card {
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    min-height: 80px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    position: relative;
    margin-bottom: 0.5rem;
}

.calc-feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.calc-feature-card h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.calc-feature-card .calc-badge {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
}

/* Export/Import Cards */
.calc-export-card,
.calc-import-card {
    transition: transform 0.2s ease;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.calc-export-card:hover,
.calc-import-card:hover {
    transform: translateY(-2px);
}

/* Formula Boxes */
.calc-formula-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #ffc107;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.calc-formula-box code {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.95em;
    color: #495057;
}

/* Accordions in Guide */
.calc-accordion-button {
    font-weight: 600;
}

.calc-accordion-button:not(.collapsed) {
    background-color: #e7f1ff;
    color: #0d6efd;
}

.calc-accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Alert Enhancements in Guide */
.calc-guide-content .calc-alert {
    border-left-width: 4px;
}

.calc-guide-content .calc-alert h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

/* Table in Guide */
.calc-guide-content .calc-table {
    font-size: 0.95rem;
}

.calc-guide-content .calc-table thead {
    background-color: #f8f9fa;
}

.calc-guide-content .calc-table th {
    font-weight: 600;
    color: #495057;
    border-bottom-width: 2px;
}

/* Large screens - 6 columns */
@media (min-width: 1400px) {
    .guide-content {
        column-count: 6;
        column-gap: 1rem;
    }
}

/* Medium screens - 3 columns (default) */

/* Responsive Guide Styles */
@media (max-width: 768px) {
    .calc-guide-content,
    .guide-content {
        padding: 0.5rem 0.25rem;
        column-count: 1;
    }

    #guideTab .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        margin-right: 0.25rem;
    }

    #guideTab .nav-link i {
        font-size: 1rem;
    }

    .calc-instruction-list li {
        padding-left: 2.5rem;
    }

    .calc-instruction-list li::before {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 1rem;
    }

    .calc-parameter-card,
    .calc-calculation-example,
    .calc-strategy-card,
    .calc-feature-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    #guideTab {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #guideTab .nav-link {
        white-space: nowrap;
    }

    .calc-guide-content h3,
    .guide-content h3 {
        font-size: 1.2rem;
    }

    .calc-guide-content h5,
    .guide-content h5 {
        font-size: 1rem;
    }

    .calc-user-guide-content {
        padding: 1rem !important;
    }
}

/* ==================== Enhanced Bulleted Lists ==================== */

/* Remove default bullets and padding */
.guide-content ul:not(.nav):not(.calc-instruction-list) {
    list-style: none;
    padding-left: 0;
}

/* Modern blue checkmark bullets */
.guide-content ul:not(.nav):not(.calc-instruction-list) > li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.guide-content ul:not(.nav):not(.calc-instruction-list) > li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: #0d6efd;
    font-weight: bold;
    font-size: 0.9rem;
    width: 1.2rem;
    height: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Nested lists - gray arrow bullets */
.guide-content ul ul li::before {
    content: '→';
    color: #6c757d;
    font-size: 1rem;
}

/* Responsive adjustments for mobile */
@media (max-width: 576px) {
    .guide-content ul:not(.nav):not(.calc-instruction-list) > li {
        padding-left: 1.25rem;
        margin-bottom: 0.15rem;
    }

    .guide-content ul:not(.nav):not(.calc-instruction-list) > li::before {
        width: 1rem;
        height: 1rem;
        font-size: 0.8rem;
    }
}
