/* Calculator Tool - Modern SaaS Design */

.calculator-tool {
    max-width: 500px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.calculator-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

/* Tabs */
.calculator-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.tab-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

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

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

/* Display */
.calculator-display {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
    text-align: right;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.display-history {
    font-size: 14px;
    color: #6b7280;
    min-height: 24px;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.display-current {
    font-size: 36px;
    font-weight: 700;
    color: #0f172a;
    word-wrap: break-word;
    line-height: 1.2;
}

/* Calculator Buttons */
.calculator-buttons {
    display: grid;
    gap: 8px;
}

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

.calc-btn {
    padding: 20px;
    border: 1.5px solid #e5e7eb;
    background: #ffffff;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calc-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.calc-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.calc-btn.number {
    background: #ffffff;
    color: #0f172a;
}

.calc-btn.operator {
    background: #f3f4f6;
    color: #6366f1;
    font-weight: 700;
}

.calc-btn.function {
    background: #f8fafc;
    color: #64748b;
    font-size: 15px;
}

.calc-btn.equals {
    background: #6366f1;
    color: #ffffff;
    border-color: #6366f1;
}

.calc-btn.equals:hover {
    background: #4f46e5;
    border-color: #4f46e5;
}

/* Scientific Calculator */
.calculator-buttons.scientific {
    font-size: 14px;
}

.calculator-buttons.scientific .calc-btn {
    padding: 16px 12px;
    font-size: 14px;
}

/* Financial Calculator */
.financial-calculators {
    display: grid;
    gap: 24px;
}

.calc-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

.calc-section h4 {
    margin: 0 0 16px 0;
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.input-group {
    margin-bottom: 14px;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    transition: all 0.2s ease;
    background: #ffffff;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

select.form-control {
    cursor: pointer;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
    width: 100%;
}

.btn-primary {
    background: #6366f1;
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

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

.result-display {
    margin-top: 16px;
    padding: 16px;
    background: #eff6ff;
    border-radius: 8px;
    border: 1px solid #dbeafe;
    color: #1e40af;
    font-weight: 600;
    font-size: 14px;
    display: none;
}

.result-display.show {
    display: block;
}

.result-display strong {
    display: block;
    margin-bottom: 8px;
    color: #1e3a8a;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-display .value {
    font-size: 24px;
    font-weight: 700;
    color: #1e40af;
}

.result-display .details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dbeafe;
    font-size: 13px;
    line-height: 1.6;
    color: #3b82f6;
}

/* Converter Section */
.converter-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
}

.converter-section .input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: end;
}

.converter-section .input-group label {
    grid-column: 1 / -1;
}

/* History */
.calculation-history {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.calculation-history h4 {
    margin: 0 0 12px 0;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#history-list {
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(2px);
}

.history-expression {
    color: #64748b;
    font-size: 13px;
    margin-right: 12px;
    flex: 1;
}

.history-result {
    color: #0f172a;
    font-weight: 600;
    font-size: 15px;
}

.no-history {
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    padding: 20px;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 640px) {
    .calculator-container {
        padding: 16px;
    }

    .calculator-tabs {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }

    .tab-btn {
        padding: 8px 10px;
        font-size: 12px;
    }

    .display-current {
        font-size: 28px;
    }

    .calc-btn {
        padding: 16px;
        font-size: 16px;
    }

    .calculator-buttons.scientific .calc-btn {
        padding: 12px 8px;
        font-size: 12px;
    }

    .converter-section .input-group {
        grid-template-columns: 1fr;
    }
}

/* Keyboard Support Indicator */
.keyboard-hint {
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    margin-top: 12px;
    font-style: italic;
}

/* Error State */
.calculator-display.error .display-current {
    color: #ef4444;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-display.show {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar Styling */
#history-list::-webkit-scrollbar {
    width: 6px;
}

#history-list::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

#history-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

#history-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}


