/* Tool Page Styles */

.tool-page {
    padding: 2rem 0 4rem;
    min-height: calc(100vh - 200px);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #64748b;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--secondary-color);
}

.breadcrumb span:not(.separator) {
    color: var(--dark-color);
    font-weight: 500;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-header h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 2.5rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.tool-header h1 svg {
    width: 48px;
    height: 48px;
    stroke: var(--primary-color);
}

.tool-description {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Tool Layout */
.tool-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    align-items: start;
}

.tool-main {
    min-width: 0;
}

/* Calculator Card */
.calculator-card {
    background: white;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 3rem;
}

/* Calculator Header */
.calculator-header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    /* padding: 2rem 2.5rem; */
    border-bottom: none;
    position: relative;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
}

.calculator-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(30deg, rgba(255,255,255,0.1) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,0.1) 87.5%, rgba(255,255,255,0.1)),
        linear-gradient(150deg, rgba(255,255,255,0.1) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,0.1) 87.5%, rgba(255,255,255,0.1));
    background-size: 80px 140px;
    background-position: 0 0, 40px 70px;
    opacity: 0.3;
}

.calculator-header h3 {
    font-size: 1.5rem;
    color: white;
    margin: 0;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

/* Calculator Card with direct h3 (no calculator-header wrapper) */
.calculator-card > h3:first-child,
.calculator-card > div:first-child > h3:first-child {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    padding: 2rem 2.5rem;
    margin: -20px -20px 20px -20px;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
}

.calculator-card > h3:first-child::before,
.calculator-card > div:first-child > h3:first-child::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(30deg, rgba(255,255,255,0.1) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,0.1) 87.5%, rgba(255,255,255,0.1)),
        linear-gradient(150deg, rgba(255,255,255,0.1) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,0.1) 87.5%, rgba(255,255,255,0.1));
    background-size: 80px 140px;
    background-position: 0 0, 40px 70px;
    opacity: 0.3;
}

/* Calculator Form Container */
.calculator-form {
    padding: 2.5rem;
}

/* Calculator Tabs */
.calculator-tabs {
    display: flex;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 1.2rem 1.5rem;
    background: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    background: white;
}

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

/* Tab Content */
.tab-content {
    display: none;
    padding: 2.5rem;
}

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

.tab-content h3 {
    font-size: 1.3rem;
    color: var(--dark-color);
    margin-bottom: 2rem;
    font-weight: 600;
}

/* Calculator Form */
.calculator-form {
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group label i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.btn-example {
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-example:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-example i {
    font-size: 0.75rem;
}

.form-group textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.6;
    transition: all 0.3s ease;
    background: #f8fafc;
    resize: vertical;
    min-height: 120px;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: white;
}

.form-group textarea::placeholder {
    color: #94a3b8;
    font-size: 0.9rem;
}

.input-hint {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
    font-style: italic;
}

.input-hint i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-calculate,
.btn-reset {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-calculate {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-reset {
    background: #f1f5f9;
    color: #64748b;
}

.btn-reset:hover {
    background: #e2e8f0;
    color: var(--dark-color);
}

/* Result Box */
.result-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.result-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-icon i {
    font-size: 1.8rem;
    color: white;
}

.result-content {
    flex: 1;
}

.result-content h4 {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.result-explanation {
    font-size: 1rem;
    color: #475569;
    margin: 0;
}

/* Result Grid for multiple values */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.result-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.result-item .result-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

/* Content Sections */
.content-section {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.content-section h2 {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 2rem;
}

.content-section h2 svg {
    width: 32px;
    height: 32px;
    stroke: var(--primary-color);
}

/* Formula Grid */
.formula-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.formula-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.formula-card h4 {
    font-size: 1.1rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.formula {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
}

.formula-card p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

/* Steps List */
.steps-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 1.1rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.step-content p {
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* Example Grid */
.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.example-card {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 2px solid #fde047;
    border-radius: 16px;
    padding: 1.5rem;
}

.example-card h4 {
    font-size: 1.1rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.example-problem {
    font-size: 0.95rem;
    color: #475569;
    margin-bottom: 1rem;
    font-style: italic;
}

.example-solution {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.example-solution strong {
    color: var(--dark-color);
}

.highlight {
    color: var(--primary-color);
    font-weight: 700;
}

.example-answer {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

/* Applications Grid */
.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.application-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.application-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.app-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.app-icon i {
    font-size: 1.5rem;
    color: white;
}

.application-card h4 {
    font-size: 1.1rem;
    color: var(--dark-color);
    margin-bottom: 0.8rem;
}

.application-card p {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* FAQ Section */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: #f8fafc;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.active {
    border-color: var(--primary-color);
}

.faq-question {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: #f1f5f9;
}

.faq-question h4 {
    font-size: 1.05rem;
    color: var(--dark-color);
    margin: 0;
    flex: 1;
}

.faq-question svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary-color);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-question svg {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 0 1.5rem 1.5rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* Sidebar */
.tool-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.sidebar-card h3 {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.2rem;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
}

.sidebar-card h3 svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary-color);
}

.related-tools {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-tools li {
    margin-bottom: 0.8rem;
}

.related-tools a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: #f8fafc;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.related-tools a:hover {
    background: var(--gradient);
    color: white;
    transform: translateX(5px);
}

.related-tools a i {
    font-size: 1.1rem;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.related-tools a:hover i {
    color: white;
}

.cta-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.cta-card h3 {
    color: white;
}

.cta-card h3 svg {
    stroke: white;
}

.cta-card p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: white;
    color: var(--primary-color);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .tool-layout {
        grid-template-columns: 1fr;
    }

    .tool-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .calculator-form {
        padding: 2.5rem 1rem;
    }

    .tool-header h1 {
        font-size: 2rem;
    }

    .tool-header h1 svg {
        width: 36px;
        height: 36px;
    }

    .calculator-tabs {
        flex-direction: column;
    }

    .tab-content {
        padding: 1.5rem;
    }

    .button-group {
        flex-direction: column;
    }

    .result-box {
        flex-direction: column;
        text-align: center;
    }

    .result-value {
        font-size: 2rem;
    }

    .content-section {
        padding: 1.5rem;
    }

    .formula-grid,
    .example-grid,
    .applications-grid {
        grid-template-columns: 1fr;
    }
}


/* Angle Converter Specific Styles */
.angle-converter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.angle-unit-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.angle-unit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.angle-unit-card:hover::before {
    transform: scaleX(1);
}

.angle-unit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
}

.angle-unit-card:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.angle-unit-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1rem;
}

.angle-unit-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.angle-unit-icon svg {
    width: 22px;
    height: 22px;
    color: white;
}

.angle-unit-info {
    flex: 1;
}

.angle-unit-info h4 {
    margin: 0 0 0.125rem 0;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.angle-unit-symbol {
    display: inline-block;
    font-size: 0.8125rem;
    color: #64748b;
    font-weight: 500;
}

.angle-input-wrapper {
    position: relative;
    margin-bottom: 0.875rem;
}

.angle-input-wrapper input {
    width: 100%;
    padding: 0.875rem 3.75rem 0.875rem 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    transition: all 0.2s ease;
    color: #1e293b;
}

.angle-input-wrapper input::placeholder {
    color: #cbd5e1;
    font-weight: 500;
}

.angle-input-wrapper input:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.angle-input-wrapper input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.angle-unit-label {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #94a3b8;
    pointer-events: none;
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.angle-unit-description {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.5;
}

.converter-actions {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.converter-actions .btn-reset {
    padding: 0.75rem 2rem;
    font-size: 0.9375rem;
    background: white;
    border: 2px solid #e2e8f0;
    color: #64748b;
    font-weight: 600;
    transition: all 0.2s ease;
}

.converter-actions .btn-reset:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
    transform: translateY(-1px);
}

.angle-result-summary {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #93c5fd;
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.result-summary-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #bfdbfe;
}

.result-summary-header i {
    font-size: 1.375rem;
    color: #3b82f6;
}

.result-summary-header h4 {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #1e40af;
}

.result-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.result-summary-item {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    border: 2px solid #dbeafe;
    transition: all 0.2s ease;
}

.result-summary-item:hover {
    border-color: #93c5fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.result-summary-item .result-label {
    display: block;
    font-size: 0.8125rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.result-summary-item .result-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 0.25rem;
    font-variant-numeric: tabular-nums;
}

.result-summary-item .result-unit {
    display: block;
    font-size: 0.8125rem;
    color: #3b82f6;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .angle-converter-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .result-summary-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .angle-unit-card {
        padding: 1rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .angle-converter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* Scientific Calculator Styles */
.scientific-calc {
    max-width: 500px;
    margin: 0 auto;
}

.calc-display-wrapper {
    margin-bottom: 1.5rem;
}

.calc-display {
    width: 100%;
    padding: 1.25rem;
    font-size: 2rem;
    font-weight: 600;
    text-align: right;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #1e293b;
    font-family: 'Courier New', monospace;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.calc-btn {
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 60px;
}

.calc-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.calc-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calc-btn.func-btn {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #475569;
    font-size: 0.9rem;
}

.calc-btn.func-btn:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.calc-btn.op-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: #2563eb;
}

.calc-btn.op-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.calc-btn.equals-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #059669;
    grid-column: span 2;
}

.calc-btn.equals-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.calc-btn.clear-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-color: #dc2626;
}

.calc-btn.clear-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Responsive adjustments for calculator */
@media (max-width: 768px) {
    .calc-display {
        font-size: 1.5rem;
        padding: 1rem;
    }

    .calc-btn {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
        min-height: 50px;
    }

    .calc-btn.func-btn {
        font-size: 0.8rem;
    }

    .calc-buttons {
        gap: 0.375rem;
    }
}

@media (max-width: 480px) {
    .calc-buttons {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.25rem;
    }

    .calc-btn {
        padding: 0.625rem 0.25rem;
        font-size: 0.8rem;
        min-height: 45px;
    }

    .calc-btn.func-btn {
        font-size: 0.7rem;
    }
}


/* Fraction Calculator Specific Styles */
.fraction-input-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.fraction-input-wrapper {
    flex: 1;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.fraction-input-wrapper:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.fraction-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.fraction-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.fraction-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.fraction-numerator,
.fraction-denominator {
    width: 100%;
    padding: 0.625rem;
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.fraction-numerator:focus,
.fraction-denominator:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
}

.fraction-divider {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
    margin: 0.25rem 0;
}

.fraction-operator {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3b82f6;
    min-width: 40px;
    text-align: center;
}

/* Responsive adjustments for fraction inputs */
@media (max-width: 768px) {
    .fraction-input-group {
        flex-direction: column;
        gap: 1rem;
    }

    .fraction-operator {
        transform: rotate(90deg);
        margin: 0.5rem 0;
    }

    .fraction-input-wrapper {
        width: 100%;
    }
}


/* FAQ Accordion Styles */
.faq-section {
    margin-top: 3rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.faq-item.active {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: #f8fafc;
}

.faq-item.active .faq-question {
    background: #eff6ff;
}

.faq-question h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
    padding-right: 1rem;
}

.faq-question svg {
    width: 20px;
    height: 20px;
    color: #64748b;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-question svg {
    transform: rotate(180deg);
    color: #3b82f6;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 1.5rem 1.25rem 1.5rem;
}

.faq-answer p {
    margin: 0;
    color: #475569;
    line-height: 1.7;
    font-size: 0.9375rem;
}

/* Ensure FAQ works on mobile */
@media (max-width: 768px) {
    .faq-question {
        padding: 1rem;
    }

    .faq-question h4 {
        font-size: 0.9375rem;
    }

    .faq-item.active .faq-answer {
        padding: 0 1rem 1rem 1rem;
    }
}


/* Stats Grid for Standard Deviation Calculator */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.stat-label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}


/* Converter Container Styles */
.converter-container {
    padding: 2rem;
}

.converter-container h3 {
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    font-size: 1.3rem;
}

.converter-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.converter-row .form-group {
    margin-bottom: 0;
}

.form-group select {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Responsive converter layout */
@media (max-width: 768px) {
    .converter-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}