/* ================================================
   DerivativeCalculus.com - Homepage Component Styles
   Extracted from index.html for browser caching
   ================================================ */

/* --- Top Pages Grid Styles --- */
                .page-card:hover {
                    transform: translateY(-10px);
                    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
                    border-color: var(--primary);
                }

                @media (max-width: 768px) {
                    .top-pages-grid {
                        grid-template-columns: 1fr;
                    }
                }

/* --- Social Proof Module Styles --- */
                .social-proof-container {
                    background: white;
                    border-radius: 24px;
                    padding: 40px;
                    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
                }

                .social-proof-header {
                    text-align: center;
                    margin-bottom: 40px;
                }

                .social-proof-header h2 {
                    color: var(--primary);
                    font-size: 32px;
                    margin-bottom: 15px;
                    font-weight: 800;
                }

                .social-proof-grid {
                    display: grid;
                    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
                    gap: 25px;
                    margin-bottom: 40px;
                }

                .social-proof-card {
                    padding: 25px;
                    background: var(--light);
                    border-radius: 16px;
                    text-align: center;
                    transition: 0.3s;
                    border: 1px solid var(--border);
                }

                .social-proof-card:hover {
                    transform: translateY(-5px);
                    border-color: var(--primary);
                }

                .social-proof-icon {
                    font-size: 32px;
                    margin-bottom: 15px;
                    color: var(--primary);
                }

                .social-proof-card h3 {
                    color: var(--dark);
                    margin-bottom: 10px;
                    font-size: 18px;
                    font-weight: 700;
                }

                .social-proof-card p {
                    color: #475569;
                    font-size: 14px;
                    line-height: 1.6;
                    margin: 0;
                }

                .social-proof-stats {
                    display: flex;
                    justify-content: center;
                    flex-wrap: wrap;
                    gap: 30px;
                    margin-top: 40px;
                    padding-top: 40px;
                    border-top: 1px solid var(--border);
                }

                .social-proof-stat {
                    text-align: center;
                }

                .social-proof-stat-number {
                    font-size: 40px;
                    font-weight: 900;
                    color: var(--primary);
                    line-height: 1;
                }

                .social-proof-stat-label {
                    font-size: 14px;
                    color: var(--text-light);
                    font-weight: 600;
                    margin-top: 8px;
                }

                @media (max-width: 768px) {
                    .social-proof-container {
                        padding: 30px 20px;
                    }

                    .social-proof-header h2 {
                        font-size: 24px;
                    }

                    .social-proof-grid {
                        grid-template-columns: 1fr;
                    }
                }

/* --- Main Non-Critical Styles --- */
        .nav-menu {
            display: flex;
            gap: 35px;
            list-style: none;
            align-items: center
        }

        .nav-menu a {
            text-decoration: none;
            color: var(--text);
            font-weight: 600;
            font-size: 16px;
            transition: all .3s;
            position: relative;
            padding: 5px 0
        }

        .nav-menu a:hover,
        .nav-menu a.active {
            color: var(--primary)
        }

        .nav-menu a::after {
            content: '';
            position: absolute;
            bottom: -5px;
            left: 0;
            width: 0;
            height: 3px;
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            transition: width .3s
        }

        .nav-menu a:hover::after,
        .nav-menu a.active::after {
            width: 100%
        }

        .mobile-toggle.active span:nth-child(1) {
            transform: rotate(45deg) translate(8px, 8px)
        }

        .mobile-toggle.active span:nth-child(2) {
            opacity: 0
        }

        .mobile-toggle.active span:nth-child(3) {
            transform: rotate(-45deg) translate(7px, -7px)
        }

        .hero-badges {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-top: 25px;
            flex-wrap: wrap
        }

        .badge {
            padding: 10px 20px;
            background: var(--light);
            border-radius: 25px;
            font-size: 14px;
            font-weight: 600;
            color: var(--primary);
            border: 2px solid var(--border)
        }

        .advanced-input-container {
            position: relative;
            margin-bottom: 30px
        }

        .input-with-tools {
            display: flex;
            gap: 15px;
            margin-bottom: 15px
        }

        .math-input-container {
            flex: 1;
            position: relative
        }

        .latex-preview {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            pointer-events: none;
            padding: 20px 28px;
            font-size: 19px;
            font-family: 'Cambria Math', 'Latin Modern Math', serif;
            color: #0f172a;
            opacity: .8;
            z-index: 1;
            display: none
        }

        .latex-preview.active {
            display: block
        }

        .math-toolbar {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: 15px;
            padding: 15px;
            background: var(--light);
            border-radius: 12px;
            border: 2px solid var(--border)
        }

        .math-btn-group {
            display: flex;
            gap: 8px;
            align-items: center;
            background: #fff;
            padding: 8px;
            border-radius: 8px;
            border: 1px solid var(--border)
        }

        .math-btn {
            padding: 10px 15px;
            background: #fff;
            border: 2px solid var(--border);
            border-radius: 8px;
            cursor: pointer;
            font-family: 'Cambria Math', serif;
            font-size: 16px;
            transition: all .2s;
            color: var(--text)
        }

        .math-btn:hover {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary);
            transform: translateY(-2px)
        }

        label {
            display: block;
            font-weight: 700;
            margin-bottom: 12px;
            color: var(--text);
            font-size: 17px
        }

        .variable-selector {
            display: flex;
            gap: 12px;
            margin-top: 18px;
            flex-wrap: wrap;
            align-items: center
        }

        .var-label {
            font-weight: 700;
            color: var(--text);
            font-size: 15px
        }

        .var-btn {
            padding: 12px 24px;
            border: 2px solid var(--border);
            background: #fff;
            border-radius: 10px;
            cursor: pointer;
            transition: all .3s;
            font-weight: 700;
            font-size: 16px;
            color: var(--text)
        }

        .var-btn:hover {
            border-color: var(--primary);
            color: var(--primary);
            transform: translateY(-2px)
        }

        .var-btn.active {
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: #fff;
            border-color: transparent;
            box-shadow: 0 6px 20px rgba(8, 145, 178, .3)
        }

        .btn-primary:active {
            transform: translateY(-1px)
        }

        .advanced-options {
            background: #fff;
            border: 2px solid var(--border);
            border-radius: 16px;
            padding: 25px;
            margin: 25px 0;
            display: none
        }

        .advanced-options.show {
            display: block;
            animation: slideDown .3s ease
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-10px)
            }

            to {
                opacity: 1;
                transform: translateY(0)
            }
        }

        .options-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-top: 20px
        }

        .option-group {
            display: flex;
            flex-direction: column;
            gap: 10px
        }

        .option-label {
            font-weight: 700;
            color: var(--text);
            font-size: 15px;
            display: flex;
            align-items: center;
            gap: 8px
        }

        .option-select {
            padding: 12px 15px;
            border: 2px solid var(--border);
            border-radius: 10px;
            font-size: 15px;
            background: #fff;
            cursor: pointer;
            font-family: inherit
        }

        .option-checkbox {
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
            user-select: none
        }

        .option-checkbox input[type="checkbox"] {
            width: 18px;
            height: 18px;
            accent-color: var(--primary)
        }

        .examples {
            margin: 30px 0;
            padding: 30px;
            background: linear-gradient(135deg, rgba(8, 145, 178, .05), rgba(20, 184, 166, .05));
            border-radius: 16px;
            border: 2px solid var(--border)
        }

        .examples h3 {
            margin-bottom: 20px;
            color: var(--primary);
            font-size: 20px;
            font-weight: 800;
            display: flex;
            align-items: center;
            gap: 10px
        }

        .example-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 12px
        }

        .example-btn {
            padding: 14px 20px;
            background: #fff;
            border: 2px solid var(--border);
            border-radius: 10px;
            cursor: pointer;
            transition: all .3s;
            font-family: 'Courier New', monospace;
            font-size: 16px;
            font-weight: 600;
            color: var(--text);
            text-align: center
        }

        .example-btn:hover {
            border-color: var(--primary);
            color: var(--primary);
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(8, 145, 178, .2);
            background: var(--light)
        }

        .results {
            background: #fff;
            border-radius: 24px;
            padding: 50px;
            margin-bottom: 40px;
            box-shadow: 0 25px 70px rgba(0, 0, 0, .15);
            display: none;
            border: 1px solid var(--border)
        }

        .results.show {
            display: block;
            animation: slideUp .5s ease
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(30px)
            }

            to {
                opacity: 1;
                transform: translateY(0)
            }
        }

        .enhanced-results {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            margin: 25px 0
        }

        .result-card {
            background: #fff;
            border: 2px solid var(--border);
            border-radius: 16px;
            padding: 25px;
            transition: all .3s
        }

        .result-card:hover {
            border-color: var(--primary);
            box-shadow: 0 10px 30px rgba(8, 145, 178, .1);
            transform: translateY(-5px)
        }

        .result-card-title {
            font-weight: 800;
            color: var(--primary);
            margin-bottom: 15px;
            font-size: 16px;
            display: flex;
            align-items: center;
            gap: 10px
        }

        .result-card-content {
            font-family: 'Cambria Math', 'Latin Modern Math', serif;
            font-size: 18px;
            color: var(--text);
            line-height: 1.6;
            padding: 15px;
            background: var(--light);
            border-radius: 10px;
            border: 1px solid var(--border);
            min-height: 60px
        }

        .interactive-graph {
            margin: 30px 0;
            background: #fff;
            border-radius: 20px;
            padding: 30px;
            border: 2px solid var(--border);
            box-shadow: 0 10px 40px rgba(0, 0, 0, .08)
        }

        .graph-tools {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
            gap: 15px
        }

        .graph-controls {
            display: flex;
            gap: 10px;
            flex-wrap: wrap
        }

        .graph-btn {
            padding: 10px 20px;
            background: #fff;
            border: 2px solid var(--border);
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            color: var(--text);
            transition: all .2s;
            display: flex;
            align-items: center;
            gap: 5px
        }

        .graph-btn:hover {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary)
        }

        .graph-container-3d {
            width: 100%;
            height: 500px;
            border-radius: 12px;
            overflow: hidden;
            margin-top: 20px;
            display: none
        }

        .graph-container-3d.show {
            display: block;
            animation: fadeIn .5s ease
        }

        .derivative-table-container {
            overflow-x: auto;
            margin: 30px 0;
            background: #fff;
            border-radius: 16px;
            padding: 25px;
            border: 2px solid var(--border)
        }

        .derivative-table {
            width: 100%;
            border-collapse: collapse;
            min-width: 600px
        }

        .derivative-table th {
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: #fff;
            padding: 15px;
            text-align: left;
            font-weight: 700;
            font-size: 15px
        }

        .derivative-table td {
            padding: 15px;
            border-bottom: 1px solid var(--border);
            font-family: 'Courier New', monospace;
            font-size: 15px
        }

        .derivative-table tr:hover {
            background: rgba(8, 145, 178, .05)
        }

        .result-box {
            padding: 30px;
            background: linear-gradient(135deg, rgba(8, 145, 178, .05), rgba(20, 184, 166, .05));
            border-radius: 16px;
            margin: 25px 0;
            border-left: 5px solid var(--secondary);
            box-shadow: 0 4px 15px rgba(0, 0, 0, .05)
        }

        .result-label {
            font-weight: 800;
            color: var(--primary);
            margin-bottom: 12px;
            font-size: 15px;
            text-transform: uppercase;
            letter-spacing: 1.2px
        }

        .result-value {
            font-size: 26px;
            font-family: 'Courier New', monospace;
            color: var(--text);
            padding: 20px;
            background: #fff;
            border-radius: 12px;
            border: 2px solid var(--border);
            font-weight: 600
        }

        .step-accordion {
            margin: 20px 0
        }

        .step-item {
            margin-bottom: 10px;
            border: 2px solid var(--border);
            border-radius: 12px;
            overflow: hidden
        }

        .step-header {
            padding: 18px 25px;
            background: #fff;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: 700;
            color: var(--text);
            transition: all .3s
        }

        .step-header:hover {
            background: var(--light)
        }

        .step-header.active {
            background: linear-gradient(135deg, rgba(8, 145, 178, .1), rgba(20, 184, 166, .1));
            color: var(--primary)
        }

        .step-content {
            padding: 0;
            max-height: 0;
            overflow: hidden;
            transition: all .3s ease;
            background: #fff
        }

        .step-content.show {
            padding: 25px;
            max-height: 1000px
        }

        .step-math {
            font-family: 'Cambria Math', 'Latin Modern Math', serif;
            font-size: 18px;
            margin: 15px 0;
            padding: 15px;
            background: var(--light);
            border-radius: 8px;
            border: 1px solid var(--border)
        }

        .step-explanation {
            color: var(--text-light);
            line-height: 1.7;
            margin-top: 10px
        }

        .steps {
            margin-top: 40px
        }

        .step {
            padding: 25px;
            margin: 18px 0;
            background: #fff;
            border-radius: 14px;
            border-left: 5px solid var(--success);
            box-shadow: 0 4px 15px rgba(0, 0, 0, .05);
            transition: all .3s
        }

        .step:hover {
            transform: translateX(5px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, .1)
        }

        .step-number {
            display: inline-block;
            width: 35px;
            height: 35px;
            background: linear-gradient(135deg, var(--success), #34d399);
            color: #fff;
            border-radius: 50%;
            text-align: center;
            line-height: 35px;
            font-weight: 800;
            margin-right: 15px;
            box-shadow: 0 4px 12px rgba(16, 185, 129, .3)
        }

        .step-content-old {
            display: inline-block;
            vertical-align: top;
            width: calc(100% - 60px)
        }

        .step-title {
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 8px
        }

        .step-description {
            color: var(--text-light);
            line-height: 1.6
        }

        .quick-actions {
            display: flex;
            gap: 10px;
            margin: 20px 0;
            flex-wrap: wrap
        }

        .quick-action-btn {
            padding: 12px 20px;
            background: #fff;
            border: 2px solid var(--border);
            border-radius: 10px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            color: var(--text);
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all .2s
        }

        .quick-action-btn:hover {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary);
            transform: translateY(-2px)
        }

        .action-buttons {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-top: 30px
        }

        .btn-secondary {
            padding: 16px 28px;
            background: #fff;
            color: var(--primary);
            border: 2px solid var(--primary);
            border-radius: 12px;
            font-weight: 700;
            cursor: pointer;
            transition: all .3s;
            font-size: 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px
        }

        .btn-secondary:hover {
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: #fff;
            border-color: transparent;
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(8, 145, 178, .3)
        }

        .enhanced-loading {
            text-align: center;
            padding: 50px;
            background: #fff;
            border-radius: 20px;
            margin: 20px 0;
            display: none
        }

        .enhanced-loading.show {
            display: block;
            animation: fadeIn .3s ease
        }

        .loading-dots {
            display: flex;
            justify-content: center;
            gap: 8px;
            margin: 20px 0
        }

        .loading-dots span {
            width: 12px;
            height: 12px;
            background: var(--primary);
            border-radius: 50%;
            animation: bounce 1.4s infinite ease-in-out
        }

        .loading-dots span:nth-child(1) {
            animation-delay: -.32s
        }

        .loading-dots span:nth-child(2) {
            animation-delay: -.16s
        }

        @keyframes bounce {

            0%,
            80%,
            100% {
                transform: scale(0)
            }

            40% {
                transform: scale(1)
            }
        }

        .enhanced-alert {
            padding: 20px;
            border-radius: 12px;
            margin: 20px 0;
            display: none;
            animation: slideIn .3s ease;
            border-left: 5px solid
        }

        .enhanced-alert.show {
            display: flex;
            align-items: center;
            gap: 15px
        }

        .alert-icon {
            font-size: 24px
        }

        .alert {
            padding: 18px 25px;
            border-radius: 12px;
            margin: 25px 0;
            display: none;
            font-weight: 600
        }

        .alert.show {
            display: block;
            animation: slideUp .3s ease
        }

        .alert-error {
            background: #fef2f2;
            color: #991b1b;
            border-left: 5px solid #dc2626
        }

        .alert-tip {
            background: #f0f9ff;
            color: #0c4a6e;
            border-left: 5px solid #0891b2
        }

        .history-panel {
            position: fixed;
            right: -400px;
            top: 80px;
            width: 380px;
            height: calc(100vh - 80px);
            background: #fff;
            box-shadow: -5px 0 30px rgba(0, 0, 0, .1);
            z-index: 999;
            transition: right .3s ease;
            padding: 25px;
            overflow-y: auto
        }

        .history-panel.show {
            right: 0
        }

        .history-item {
            padding: 15px;
            margin: 10px 0;
            background: var(--light);
            border-radius: 10px;
            border: 1px solid var(--border);
            cursor: pointer;
            transition: all .2s
        }

        .history-item:hover {
            background: #fff;
            border-color: var(--primary);
            transform: translateX(-5px)
        }

        .action-buttons {
            display: flex;
            gap: 10px;
            margin: 20px 0;
            flex-wrap: wrap
        }

        .action-buttons button,
        .share-dropdown {
            position: relative;
            padding: 10px 16px;
            border: none;
            border-radius: 8px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: all .25s ease;
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 44px;
            min-height: 44px;
            justify-content: center
        }

        .btn-calculate {
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: #fff;
            flex: 1;
            max-width: 150px
        }

        .btn-clear {
            background: #f1f5f9;
            color: var(--text);
            flex: 0 0 auto
        }

        .btn-export {
            background: #10b981;
            color: #fff;
            flex: 0 0 auto
        }

        .btn-share {
            background: #3b82f6;
            color: #fff;
            flex: 0 0 auto
        }

        .action-buttons button:not(:disabled):hover,
        .share-dropdown:hover .btn-share {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
            opacity: .95
        }

        .action-buttons button:active,
        .share-dropdown:active .btn-share {
            transform: translateY(0)
        }

        .share-dropdown {
            position: relative;
            display: inline-block
        }

        .share-dropdown-content {
            display: none;
            position: absolute;
            right: 0;
            background-color: #fff;
            min-width: 200px;
            box-shadow: 0 8px 16px rgba(0, 0, 0, .1);
            border-radius: 8px;
            z-index: 1000;
            padding: 8px 0;
            margin-top: 8px;
            opacity: 0;
            transform: translateY(-10px);
            transition: opacity .2s, transform .2s
        }

        .share-dropdown:hover .share-dropdown-content {
            display: block;
            opacity: 1;
            transform: translateY(0)
        }

        .share-dropdown-content a {
            color: var(--text);
            padding: 10px 16px;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 10px;
            transition: background-color .2s
        }

        .share-dropdown-content a:hover {
            background-color: #f8fafc
        }

        .share-dropdown-content i {
            width: 20px;
            text-align: center
        }

        .action-buttons button:focus-visible,
        .share-dropdown-content a:focus-visible {
            outline: 3px solid #3b82f6;
            outline-offset: 2px
        }

        @media (max-width:768px) {
            .action-buttons {
                gap: 8px
            }

            .action-buttons button {
                padding: 10px 12px;
                font-size: 14px
            }

            .btn-calculate {
                flex: 1 0 100%;
                max-width: 100%
            }

            .share-dropdown-content {
                min-width: 180px;
                right: 0;
                left: auto
            }
        }

        .fab {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 60px;
            height: 60px;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 10px 30px rgba(8, 145, 178, .3);
            z-index: 100;
            transition: all .3s;
            color: #fff;
            font-size: 24px
        }

        .fab:hover {
            transform: scale(1.1) rotate(90deg);
            box-shadow: 0 15px 40px rgba(8, 145, 178, .4)
        }

        .fab-menu {
            position: absolute;
            bottom: 70px;
            right: 0;
            background: #fff;
            border-radius: 15px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, .15);
            padding: 15px;
            display: none;
            flex-direction: column;
            gap: 10px;
            min-width: 200px
        }

        .fab-menu.show {
            display: flex;
            animation: slideUp .3s ease
        }

        .fab-item {
            padding: 12px 15px;
            background: #fff;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 10px;
            transition: all .2s;
            font-size: 14px;
            color: var(--text)
        }

        .fab-item:hover {
            background: var(--light);
            color: var(--primary)
        }

        .features {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 30px;
            margin: 40px 0
        }

        .feature-card {
            background: #fff;
            padding: 40px 35px;
            border-radius: 20px;
            box-shadow: 0 12px 35px rgba(0, 0, 0, .1);
            transition: all .3s;
            border: 2px solid transparent
        }

        .feature-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 20px 50px rgba(0, 0, 0, .15);
            border-color: var(--secondary)
        }

        .feature-icon {
            font-size: 48px;
            margin-bottom: 20px
        }

        .feature-card h3 {
            margin-bottom: 12px;
            color: var(--primary);
            font-size: 22px;
            font-weight: 800
        }

        .feature-card p {
            color: var(--text-light);
            line-height: 1.7;
            font-size: 15px
        }

        .calculator-types {
            background: #fff;
            border-radius: 24px;
            padding: 50px;
            margin-bottom: 40px;
            box-shadow: 0 25px 70px rgba(0, 0, 0, .15)
        }

        .calc-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-top: 30px
        }

        .calc-card {
            padding: 25px;
            background: linear-gradient(135deg, rgba(8, 145, 178, .05), rgba(20, 184, 166, .05));
            border-radius: 16px;
            border: 2px solid var(--border);
            transition: all .3s;
            cursor: pointer;
            text-decoration: none;
            display: block
        }

        .calc-card:hover {
            border-color: var(--primary);
            transform: translateY(-5px);
            box-shadow: 0 12px 30px rgba(8, 145, 178, .2)
        }

        .calc-card h4 {
            color: var(--primary);
            margin-bottom: 10px;
            font-size: 18px;
            font-weight: 700
        }

        .calc-card p {
            color: var(--text-light);
            font-size: 14px;
            line-height: 1.6
        }

        footer {
            background: rgba(8, 145, 178, .95);
            color: #fff;
            padding: 60px 30px 30px;
            margin-top: 60px
        }

        .footer-container {
            max-width: 1400px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 40px;
            margin-bottom: 40px
        }

        .footer-section h3 {
            margin-bottom: 20px;
            font-size: 20px;
            font-weight: 800;
            color: var(--secondary)
        }

        .footer-section ul {
            list-style: none
        }

        .footer-section ul li {
            margin-bottom: 12px
        }

        .footer-section a {
            color: rgba(255, 255, 255, .8);
            text-decoration: none;
            transition: all .3s;
            font-size: 15px
        }

        .footer-section a:hover {
            color: var(--secondary);
            padding-left: 5px
        }

        .footer-bottom {
            text-align: center;
            padding-top: 30px;
            border-top: 1px solid rgba(255, 255, 255, .1);
            color: rgba(255, 255, 255, .7)
        }

        .loading {
            display: none;
            text-align: center;
            padding: 40px
        }

        .loading.show {
            display: block
        }

        .spinner {
            border: 5px solid var(--border);
            border-top: 5px solid var(--primary);
            border-radius: 50%;
            width: 60px;
            height: 60px;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px
        }

        @keyframes spin {
            0% {
                transform: rotate(0deg)
            }

            100% {
                transform: rotate(360deg)
            }
        }

        @media (max-width:768px) {
            .hero-badges {
                flex-direction: column;
                align-items: center
            }

            .section-title {
                font-size: 24px
            }

            .calculator-wrapper,
            .results,
            .calculator-types {
                padding: 30px 20px
            }

            .action-buttons {
                grid-template-columns: 1fr
            }

            .features {
                grid-template-columns: 1fr
            }

            .input-with-tools {
                flex-direction: column
            }

            .math-toolbar {
                justify-content: center
            }

            .math-btn {
                padding: 8px 12px;
                font-size: 14px
            }

            .options-grid {
                grid-template-columns: 1fr
            }

            .graph-tools {
                flex-direction: column;
                align-items: stretch
            }

            .graph-controls {
                justify-content: center
            }

            .history-panel {
                width: 100%;
                right: -100%
            }

            .derivative-table-container {
                margin: 15px -20px;
                border-radius: 0;
                border-left: none;
                border-right: none
            }

            .graph-container-3d {
                height: 300px
            }

            .enhanced-results {
                grid-template-columns: 1fr
            }

            .quick-actions {
                flex-direction: column
            }

            .quick-action-btn {
                width: 100%;
                justify-content: center
            }
        }

        @media (max-width:480px) {

            .calc-grid,
            .example-grid {
                grid-template-columns: 1fr
            }

            h1 {
                font-size: 28px
            }

            .subtitle {
                font-size: 16px
            }

            .hero {
                padding: 30px 20px
            }

            .math-btn {
                padding: 6px 10px;
                font-size: 13px
            }

            .graph-container-3d {
                height: 250px
            }

            /* Ensure order selector label is always visible on mobile */
            .order-label, label[for="derivOrder"], [data-label="order"] {
                display: block !important;
                font-size: 13px !important;
                white-space: normal !important;
                overflow: visible !important;
                clip: auto !important;
            }

            select#derivOrder {
                width: 100%;
                font-size: 14px;
                padding: 8px;
            }
        }

        /* Accessibility fixes */
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }



/* ================================================
   CALCMENTOR-STYLE NAVIGATION & ACTION BUTTONS
   ================================================ */
nav {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--secondary, #14b8a6);
    width: 100%;
}
.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-img {
    width: 46px;
    height: 46px;
    border-radius: 10px;
}
.logo-text {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary, #0891b2), var(--secondary, #14b8a6));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-menu {
    display: flex;
    gap: 28px;
    list-style: none;
    align-items: center;
}
.nav-menu a {
    text-decoration: none;
    color: var(--text, #0f172a);
    font-weight: 600;
    font-size: 14.5px;
    transition: color 0.25s;
}
.nav-menu a:hover, .nav-menu a.active {
    color: var(--primary, #0891b2);
}
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
}
.mobile-toggle span {
    width: 26px;
    height: 2.5px;
    background: var(--primary, #0891b2);
    border-radius: 3px;
    transition: all 0.3s;
}

/* CALCMENTOR-STYLE ACTION BUTTONS FOR RESULTS */
.answer-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    background: white;
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #0f172a);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}
.action-btn:hover {
    border-color: var(--primary, #0891b2);
    color: var(--primary, #0891b2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.15);
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 72px;
        flex-direction: column;
        background: white;
        width: 100%;
        padding: 24px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
        transition: left 0.3s ease;
        gap: 18px;
        z-index: 999;
    }
    .nav-menu.active {
        left: 0;
    }
    .mobile-toggle {
        display: flex;
    }
    .action-btn {
        width: 100%;
    }
}