* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Navigation */
.calculator-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.nav-btn {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.nav-btn.active {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

.nav-btn i {
    margin-right: 8px;
}

/* Calculator Sections */
.calculator-section {
    display: none;
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.calculator-section.active {
    display: block;
}

/* Basic Calculator */
.calculator {
    max-width: 400px;
    margin: 0 auto;
}

.display {
    background: #1a1a1a;
    color: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: right;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
}

.display-history {
    font-size: 0.9rem;
    color: #888;
    min-height: 20px;
    margin-bottom: 10px;
}

.display-current {
    font-size: 2.5rem;
    font-weight: bold;
    min-height: 50px;
    word-break: break-all;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.btn {
    border: none;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 60px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-number {
    background: #f8f9fa;
    color: #333;
}

.btn-number:hover {
    background: #e9ecef;
}

.btn-operator {
    background: #ff6b6b;
    color: white;
}

.btn-operator:hover {
    background: #ff5252;
}

.btn-equals {
    background: #4ecdc4;
    color: white;
    grid-column: span 1;
}

.btn-equals:hover {
    background: #26a69a;
}

.btn-clear {
    background: #ffa726;
    color: white;
}

.btn-clear:hover {
    background: #ff9800;
}

.btn-zero {
    grid-column: span 2;
}

/* Scientific Calculator */
.scientific-calc {
    max-width: 600px;
    margin: 0 auto;
}

.scientific-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.btn-function {
    background: #9c27b0;
    color: white;
    font-size: 1rem;
}

.btn-function:hover {
    background: #8e24aa;
}

/* Unit Converter */
.converter {
    max-width: 600px;
    margin: 0 auto;
}

.converter h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 1.8rem;
}

.converter-type {
    margin-bottom: 30px;
}

.converter-type select {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.1rem;
    background: white;
}

.converter-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: bold;
    margin-bottom: 10px;
    color: #555;
}

.input-group select,
.input-group input {
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Financial Calculator */
.financial {
    max-width: 700px;
    margin: 0 auto;
}

.financial h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 1.8rem;
}

.financial-tabs,
.geometry-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

.tab-btn {
    background: #f8f9fa;
    border: 2px solid #ddd;
    color: #333;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #e9ecef;
}

.tab-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.financial-tab,
.geometry-tab {
    display: none;
}

.financial-tab.active,
.geometry-tab.active {
    display: block;
}

.financial-tab h4,
.geometry-tab h4 {
    text-align: center;
    margin-bottom: 25px;
    color: #555;
    font-size: 1.4rem;
}

.btn-calculate {
    background: #4ecdc4;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin: 20px 0;
    transition: all 0.3s ease;
}

.btn-calculate:hover {
    background: #26a69a;
    transform: translateY(-2px);
}

.result {
    background: #f8f9fa;
    border-left: 4px solid #4ecdc4;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.result h5 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.result p {
    color: #666;
    margin-bottom: 8px;
}

.result .highlight {
    font-weight: bold;
    color: #4ecdc4;
    font-size: 1.2rem;
}

/* Geometry Calculator */
.geometry {
    max-width: 600px;
    margin: 0 auto;
}

.geometry h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 1.8rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .calculator-nav {
        gap: 5px;
    }

    .nav-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .calculator-section {
        padding: 20px;
    }

    .display-current {
        font-size: 2rem;
    }

    .buttons {
        gap: 10px;
    }

    .btn {
        height: 50px;
        font-size: 1rem;
    }

    .scientific-buttons {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .converter-inputs {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .financial-tabs,
    .geometry-tabs {
        flex-direction: column;
        align-items: center;
    }

    .tab-btn {
        width: 200px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .nav-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .display-current {
        font-size: 1.5rem;
    }

    .btn {
        height: 45px;
        font-size: 0.9rem;
    }

    .scientific-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Animation for calculator switching */
.calculator-section {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error messages */
.success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

/* Hover effects for input fields */
input:hover,
select:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}


