/* Math Page Specific Styles */
    :root {
        --math-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
        --math-gradient-dark: linear-gradient(135deg, #320735 0%, #143ca0 50%, #3d0c48 100%);
        --success-light: #34d399;
        --min-vh-70: 70vh;
    }

    @media (prefers-color-scheme: dark) {
        :root {
            --math-gradient: var(--math-gradient-dark);
        }
    }

    /* Global Math Utilities */
    .min-vh-70 {
        min-height: var(--min-vh-70);
    }

    .text-success-light {
        color: var(--success-light);
    }

    .gradient-text-light {
        background: linear-gradient(135deg, #34d399, #22d3ee);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    /* Modern Breadcrumb */
    .modern-breadcrumb {
        background: transparent;
        padding: 0;
    }

    .modern-breadcrumb .breadcrumb-item+.breadcrumb-item::before {
        content: "•";
        color: rgba(255, 255, 255, 0.6);
    }

    /* === MATH HERO SECTION === */
    .math-hero-section {
        min-height: 90vh;
        position: relative;
        display: flex;
        align-items: center;
    }

    .math-hero-bg {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--math-gradient);
        z-index: 0;
    }

    .math-hero-content {
        z-index: 2;
    }

    .math-badge .badge-modern {
        display: inline-flex;
        align-items: center;
        padding: 0.5rem 1rem;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 2rem;
        color: white;
        font-size: 0.875rem;
        font-weight: 500;
    }

    .math-features {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
        margin: 2rem 0;
    }

    .math-feature-item {
        display: flex;
        align-items: center;
        padding: 0.75rem;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        border-radius: var(--radius-lg);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .math-actions .btn {
        transition: all 0.3s ease;
    }

    .math-actions .btn:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-large);
    }

    /* Math floating elements and other components */
    .math-floating-elements {
        position: relative;
        width: 400px;
        height: 400px;
        margin: 0 auto;
        overflow: hidden;
        /* Ensure formulas stay within bounds */
    }

    .math-element {
        position: absolute;
        width: 100px;
        height: 100px;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 1rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: white;
        transition: all 0.4s ease;
        cursor: pointer;
        z-index: 5;
        /* Ensure math elements are above formulas but below interactive elements */
    }

    .element-1 {
        left: 50%;
        transform: translateX(-50%);
    }

    .element-2 {
        top: 50%;
        transform: translateY(-50%);
    }

    .element-3 {
        bottom: 0px;
        left: 50%;
        transform: translateX(-50%);
    }

    .element-4 {
        top: 50%;
        right: 0px;
        transform: translateY(-50%);
    }

    .math-center-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 140px;
        height: 140px;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(20px);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .math-center-icon i {
        font-size: 3.5rem;
        color: white;
    }

    /* Mathematical Formula Elements */
    .math-formula {
        position: absolute;
        font-size: 1rem;
        color: rgba(255, 255, 255, 0.2);
        opacity: 0;
        transition: opacity 0.8s ease;
        pointer-events: none;
        font-weight: normal;
        text-shadow: 0 0 3px rgba(255, 255, 255, 0.1);
        width: 20px;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
    }

    .math-formula.visible {
        opacity: 0.5;
    }

    /* CTA Mathematical Formula Elements */
    .math-cta-bg {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--math-gradient);
        z-index: 0;
    }

    /* CTA Mathematical Formula Elements */
    .math-cta-formulas {
        position: relative;
        width: 100%;
        height: 100%;
        overflow: hidden;
        /* Ensure formulas stay within bounds */
    }

    .math-cta-formula {
        position: absolute;
        font-size: 1.2rem;
        color: rgba(255, 255, 255, 0.15);
        opacity: 0;
        transition: opacity 1s ease;
        pointer-events: none;
        font-weight: normal;
        text-shadow: 0 0 4px rgba(255, 255, 255, 0.1);
        width: 25px;
        height: 25px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
    }

    .math-cta-formula.visible {
        opacity: 0.8;
    }

    /* Primary tools grid */
    .math-primary-tools-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 3rem;
        margin-bottom: 4rem;
    }

    .math-feature-card {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        background: var(--bg-card-light);
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 1rem;
        padding: 2rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        transition: all 0.4s ease;
        min-height: 400px;
    }

    [data-bs-theme="dark"] .math-feature-card {
        background: var(--bg-card-dark);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .feature-visual {
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #f8fafc, #e2e8f0);
        border-radius: 0.5rem;
        padding: 1.5rem;
    }

    [data-bs-theme="dark"] .feature-visual {
        background: linear-gradient(135deg, #1e293b, #334155);
    }

    .app-window {
        background: white;
        border-radius: 12px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
        overflow: hidden;
        width: 100%;
        max-width: 300px;
    }

    [data-bs-theme="dark"] .app-window {
        background: #1e293b;
    }

    .app-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        background: #f8fafc;
        border-bottom: 1px solid #e2e8f0;
    }

    [data-bs-theme="dark"] .app-header {
        background: #0f172a;
        border-bottom-color: #334155;
    }

    .window-controls {
        display: flex;
        gap: 0.5rem;
    }

    .control {
        width: 12px;
        height: 12px;
        border-radius: 50%;
    }

    .control.red {
        background: #ef4444;
    }

    .control.yellow {
        background: #f59e0b;
    }

    .control.green {
        background: #10b981;
    }

    .app-title {
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--text-light);
    }

    .calculator-interface,
    .financial-interface {
        padding: 1rem;
    }

    .calculator-display {
        background: #1e293b;
        color: white;
        padding: 1rem;
        border-radius: 8px;
        margin-bottom: 1rem;
        text-align: right;
    }

    .calculator-buttons {
        display: grid;
        gap: 0.5rem;
    }

    .button-row {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }

    .calc-btn {
        padding: 0.5rem;
        border: none;
        border-radius: 6px;
        font-size: 0.75rem;
        cursor: pointer;
        background: #f1f5f9;
        color: #1e293b;
    }

    .calc-btn.function {
        background: #10b981;
        color: white;
    }

    .calc-btn.operator {
        background: #f59e0b;
        color: white;
    }

    .calc-btn.active {
        background: #3b82f6;
        color: white;
    }

    /* Feature info */
    .feature-info {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .feature-icon {
        width: 80px;
        height: 80px;
        border-radius: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .feature-name {
        font-size: 1.75rem;
        font-weight: 700;
        color: var(--text-light);
        margin-bottom: 1rem;
    }

    .feature-description {
        font-size: 1.1rem;
        color: var(--text-muted-light);
        line-height: 1.6;
        margin-bottom: 2rem;
    }

    .feature-stats {
        display: flex;
        gap: 2rem;
        margin-bottom: 2rem;
    }

    .stat-number {
        display: block;
        font-size: 2rem;
        font-weight: 800;
        color: var(--primary);
        line-height: 1;
        margin-bottom: 0.5rem;
    }

    .stat-label {
        font-size: 0.875rem;
        color: var(--text-muted-light);
        font-weight: 500;
    }

    .feature-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.75rem;
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: white;
        text-decoration: none;
        padding: 1rem 2rem;
        border-radius: 0.5rem;
        font-weight: 600;
        transition: all 0.3s ease;
        align-self: flex-start;
    }

    .feature-btn:hover {
        transform: translateY(-2px);
        color: white;
    }

    /* Compact converter cards */
    .math-converter-card-compact {
        background: var(--bg-card-light);
        border: 1px solid rgba(59, 130, 246, 0.1);
        border-radius: 0.5rem;
        padding: 1.75rem;
        transition: all 0.4s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        position: relative;
        text-align: center;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 180px;
    }

    [data-bs-theme="dark"] .math-converter-card-compact {
        background: var(--bg-card-dark);
        border-color: rgba(59, 130, 246, 0.2);
    }

    .math-converter-card-compact:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    }

    .math-converter-icon {
        width: 60px;
        height: 60px;
        border-radius: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }

    .math-converter-title {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--text-light);
        margin-bottom: 0.75rem;
    }

    .math-converter-desc {
        font-size: 0.9rem;
        color: var(--text-muted-light);
        margin-bottom: 1.25rem;
        line-height: 1.5;
    }

    .math-converter-link {
        position: absolute;
        top: 1rem;
        right: 1rem;
        width: 32px;
        height: 32px;
        background: var(--primary);
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        transition: all 0.3s ease;
        opacity: 0;
    }

    .math-converter-card-compact:hover .math-converter-link {
        opacity: 1;
    }

    /* CTA Section */
    .math-cta-section {
        background: var(--math-gradient);
        color: white;
    }

    .math-cta-bg {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--math-gradient);
        z-index: 0;
    }

    /* CTA Mathematical Formula Elements */
    .math-cta-formulas {
        position: relative;
        width: 100%;
        height: 100%;
    }

    .math-cta-formula {
        position: absolute;
        font-size: 1.2rem;
        color: #ffffff opacity: 0;
        pointer-events: none;
        font-weight: normal;
        text-shadow: 0 0 4px rgba(255, 255, 255, 0.1);
        width: 25px;
        height: 25px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1;
    }

    .math-cta-formula.visible {
        opacity: 1;
    }

    .math-cta-badge .badge-modern-light {
        display: inline-flex;
        align-items: center;
        padding: 0.5rem 1rem;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 2rem;
        color: white;
        font-size: 0.875rem;
        font-weight: 500;
    }

    /* Responsive */
    @media (max-width: 768px) {
        .math-floating-elements {
            width: 300px;
            height: 300px;
        }

        .math-element {
            width: 80px;
            height: 80px;
        }

        .math-center-icon {
            width: 110px;
            height: 110px;
        }

        .math-center-icon i {
            font-size: 2.5rem;
        }

        .math-feature-card {
            grid-template-columns: 1fr;
            gap: 1rem;
            min-height: auto;
        }

        .feature-stats {
            gap: 1rem;
        }
    }

    @media (max-width: 576px) {
        .math-floating-elements {
            width: 250px;
            height: 250px;
        }

        .math-element {
            width: 70px;
            height: 70px;
        }

        .math-center-icon {
            width: 90px;
            height: 90px;
        }

        .math-center-icon i {
            font-size: 2rem;
        }
    }

    /* Rule of 3 Interface */
    .rule3-interface {
        padding: 1rem;
    }

    .proportion-display {
        background: #f8fafc;
        border-radius: 8px;
        padding: 1.5rem;
        margin-bottom: 1rem;
        text-align: center;
    }

    [data-bs-theme="dark"] .proportion-display {
        background: #334155;
    }

    .proportion-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        margin-bottom: 0.5rem;
    }

    .prop-input {
        width: 80px;
        padding: 0.5rem;
        border: 2px solid #e2e8f0;
        border-radius: 6px;
        text-align: center;
        font-weight: 600;
        background: white;
        font-size: 0.875rem;
    }

    [data-bs-theme="dark"] .prop-input {
        background: #1e293b;
        border-color: #475569;
        color: white;
    }

    .result-input {
        border-color: #3b82f6;
        background: rgba(59, 130, 246, 0.1);
        color: #3b82f6;
        font-weight: 700;
    }

    .prop-separator {
        font-size: 0.75rem;
        color: var(--text-muted-light);
        font-weight: 500;
    }

    .proportion-equals {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--primary);
        margin: 0.5rem 0;
    }

    .calculation-steps {
        background: white;
        border-radius: 8px;
        padding: 1rem;
        border: 1px solid #e2e8f0;
    }

    [data-bs-theme="dark"] .calculation-steps {
        background: #1e293b;
        border-color: #334155;
    }

    .step {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #e2e8f0;
    }

    [data-bs-theme="dark"] .step {
        border-bottom-color: #475569;
    }

    .step-label {
        font-size: 0.75rem;
        color: var(--text-muted-light);
        font-weight: 500;
    }

    .step-formula {
        font-family: 'Courier New', monospace;
        font-size: 0.75rem;
        color: var(--text-light);
        background: #f1f5f9;
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
    }

    [data-bs-theme="dark"] .step-formula {
        background: #475569;
    }

    .result-display {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: none;
        padding-top: 0;
    }

    .result-label {
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--text-light);
    }

    .result-value {
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--success);
    }

    /* Work Hours Interface */
    .workhours-interface {
        padding: 1rem;
    }

    .time-inputs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .time-field {
        text-align: center;
    }

    .time-field label {
        display: block;
        font-size: 0.75rem;
        font-weight: 500;
        color: var(--text-light);
        margin-bottom: 0.25rem;
    }

    .time-field input {
        width: 100%;
        padding: 0.375rem;
        border: 1px solid #e2e8f0;
        border-radius: 4px;
        text-align: center;
        font-weight: 600;
        font-size: 0.75rem;
    }

    .rate-input {
        margin-bottom: 1rem;
        text-align: center;
    }

    .rate-input label {
        display: block;
        font-size: 0.75rem;
        font-weight: 500;
        color: var(--text-light);
        margin-bottom: 0.25rem;
    }

    .currency-input {
        display: flex;
        justify-content: center;
        align-items: center;
        max-width: 150px;
        margin: 0 auto;
    }

    .currency-input .currency {
        background: #e2e8f0;
        color: #64748b;
        padding: 0.375rem 0.5rem;
        border-radius: 4px 0 0 4px;
        font-weight: 600;
        font-size: 0.75rem;
    }

    .currency-input input {
        flex: 1;
        padding: 0.375rem;
        border: 1px solid #e2e8f0;
        border-left: none;
        border-radius: 0 4px 4px 0;
        text-align: center;
        font-weight: 600;
        font-size: 0.75rem;
    }

    .results-summary {
        background: #f8fafc;
        border-radius: 6px;
        padding: 0.75rem;
    }

    [data-bs-theme="dark"] .results-summary {
        background: #334155;
    }

    .results-summary .result-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.5rem;
        padding: 0.25rem 0;
    }

    .results-summary .result-item:last-child {
        margin-bottom: 0;
    }

    .results-summary .result-item.total {
        border-top: 1px solid #e2e8f0;
        padding-top: 0.5rem;
        font-weight: 700;
    }

    [data-bs-theme="dark"] .results-summary .result-item.total {
        border-top-color: #475569;
    }

    .results-summary .label {
        font-size: 0.75rem;
        color: var(--text-muted-light);
    }

    .results-summary .value {
        font-size: 0.875rem;
        font-weight: 600;
        color: var(--success);
    }

    .results-summary .total .value {
        font-size: 1rem;
        color: var(--primary);
    }
