/* Modern Color Scheme */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #0ea5e9;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-bg: #f8fafc;
    --dark-text: #1e293b;
    --medium-text: #64748b;
    --light-text: #94a3b8;
    --white: #ffffff;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: var(--dark-text);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 40px auto;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.header {
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Tab Styles */
.tabs {
    display: flex;
    background: var(--light-bg);
    border-bottom: 1px solid #e2e8f0;
}

.tab-button {
    flex: 1;
    padding: 16px;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--medium-text);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

.calculator-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

@media (max-width: 768px) {
    .calculator-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    body {
        padding: 10px;
    }
    
    .header {
        padding: 20px 15px;
    }
    
    .tabs {
        flex-direction: column;
    }
}

.inputs-section, .results-section {
    padding: 20px;
}

.inputs-section {
    background: var(--light-bg);
    border-radius: var(--border-radius);
}

.results-section {
    display: flex;
    flex-direction: column;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title svg {
    width: 24px;
    height: 24px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-text);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.styled-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

/* Toggle Switch */
.input-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--white);
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.toggle-label {
    font-weight: 500;
    color: var(--dark-text);
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.toggle-text {
    font-weight: 500;
    color: var(--medium-text);
    margin-left: 10px;
}

.calculate-btn {
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border: none;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    margin-top: 10px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

.calculate-btn:active {
    transform: translateY(0);
}

.results-card {
    background: linear-gradient(120deg, #f0fdf4, #dcfce7);
    border-radius: var(--border-radius);
    padding: 25px;
    flex-grow: 1;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--dark-text);
}

.result-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--success-color);
}

.explanation {
    background: #eff6ff;
    border-radius: var(--border-radius);
    padding: 25px;
    margin: 30px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.explanation h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.explanation p {
    margin-bottom: 15px;
    color: var(--medium-text);
}

.formula {
    background: var(--white);
    padding: 15px;
    border-radius: 8px;
    font-family: 'Consolas', 'Courier New', monospace;
    margin: 15px 0;
    border-left: 4px solid var(--primary-color);
    font-size: 1.1rem;
    font-weight: 500;
}

.example {
    background: #fffbeb;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border-left: 4px solid var(--warning-color);
}

.example h3 {
    color: var(--warning-color);
    margin-bottom: 10px;
}

.example ul {
    padding-left: 20px;
}

.example li {
    margin-bottom: 8px;
}

footer {
    text-align: center;
    padding: 20px;
    color: var(--medium-text);
    font-size: 0.9rem;
    border-top: 1px solid #e2e8f0;
}

/* Forex Calculator Specific Styles */
.forex-calculator h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

/* Animation for results */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        margin: 20px auto;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .calculator-content {
        padding: 20px;
    }
    
    .inputs-section, .results-section {
        padding: 15px;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .explanation {
        margin: 20px 15px;
        padding: 20px;
    }
    
    .tab-button {
        padding: 12px;
        font-size: 1rem;
    }
}