/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #2563eb;
}

/* Main Content */
.main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Calculator Section */
.calculator-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    backdrop-filter: blur(10px);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    text-align: center;
}

.section-description {
    font-size: 1.1rem;
    color: #6b7280;
    text-align: center;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Calculator Form */
.calculator-form {
    max-width: 600px;
    margin: 0 auto 3rem;
}

.main-input-section {
    margin-bottom: 2rem;
}

.input-row {
    display: flex;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
}

.input-row .input-group,
.input-row .period-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group {
    flex: 2;
}

.period-selector {
    flex: 1;
}

.period-dropdown {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    background: white;
    transition: all 0.2s ease;
    height: 3.5rem; /* Match the height of the input field */
    box-sizing: border-box;
}

.period-dropdown:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.advanced-options {
    margin-top: 2rem;
}

.advanced-toggle {
    background: none;
    border: none;
    color: #2563eb;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.9rem;
    padding: 0;
    margin-bottom: 1rem;
}

.advanced-toggle:hover {
    color: #1d4ed8;
}

.advanced-fields {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
}

.advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.advanced-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.advanced-field label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.advanced-field input {
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.advanced-field input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-with-reset {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reset-btn {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reset-btn:hover {
    background: #e5e7eb;
    color: #374151;
    border-color: #9ca3af;
}

.reset-btn:active {
    transform: scale(0.95);
}

/* Removed duplicate .input-group definition */

.input-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 1rem;
    color: #6b7280;
    font-weight: 500;
    font-size: 1.1rem;
}

.income-input {
    width: 100%;
    padding: 1rem 1rem 1rem 2rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: white;
    height: 3.5rem; /* Match the dropdown height */
    box-sizing: border-box;
}

.income-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.income-input::placeholder {
    color: #9ca3af;
}

/* Calculation Mode */
.calculation-mode {
    text-align: center;
}

.mode-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.mode-toggle {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.mode-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.mode-btn.active {
    background: white;
    color: #2563eb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mode-btn:hover:not(.active) {
    color: #374151;
}

/* Results Display */
.results-container {
    margin-top: 3rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.result-card {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.result-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    font-family: 'Arial', sans-serif;
}

/* About Section */
.about-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    backdrop-filter: blur(10px);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1.1rem;
    color: #4b5563;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.about-text h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.calculation-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.method {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

.method:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.method h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.method ul {
    list-style: none;
    padding: 0;
}

.method li {
    padding: 0.5rem 0;
    color: #4b5563;
    position: relative;
    padding-left: 1.5rem;
}

.method li::before {
    content: "•";
    color: #2563eb;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* FAQ Section */
.faq-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    backdrop-filter: blur(10px);
}

/* Guide Section */
.guide-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    backdrop-filter: blur(10px);
}

.guide-content {
    max-width: 900px;
    margin: 0 auto;
}

.guide-section-block {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.guide-section-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.guide-section-block h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.guide-section-block p {
    font-size: 1.1rem;
    color: #4b5563;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

/* Tips Section */
.tips-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    backdrop-filter: blur(10px);
}

.tips-content {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tip-item {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

.tip-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.tip-item h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.tip-item p {
    font-size: 1rem;
    color: #4b5563;
    line-height: 1.6;
}

/* Insights Section */
.insights-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    backdrop-filter: blur(10px);
}

.insights-content {
    max-width: 900px;
    margin: 0 auto;
}

.insight-block {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.insight-block:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.insight-block h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.insight-block p {
    font-size: 1.1rem;
    color: #4b5563;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.faq-content {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-question {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.faq-answer {
    color: #4b5563;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: #1f2937;
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: white;
}

/* Ad Placement Areas */
.ad-banner-top {
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
    border-radius: 8px;
    color: #6b7280;
    font-size: 0.9rem;
}

.ad-banner-sidebar {
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    width: 300px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #6b7280;
    font-size: 0.9rem;
}

.ad-banner-bottom {
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
    border-radius: 8px;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .calculator-section,
    .about-section,
    .guide-section,
    .tips-section,
    .insights-section,
    .faq-section {
        padding: 2rem 1.5rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .result-value {
        font-size: 1.2rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        gap: 1.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .calculation-methods {
        grid-template-columns: 1fr;
    }
    
    .mode-toggle {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .mode-btn {
        width: 100%;
    }
    
    .tips-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .guide-section-block h3,
    .insight-block h3 {
        font-size: 1.3rem;
    }
    
    .guide-section-block p,
    .insight-block p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-description {
        font-size: 1rem;
    }
    
    .income-input {
        font-size: 1.1rem;
        padding: 0.875rem 0.875rem 0.875rem 1.75rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .result-card {
        padding: 1rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-2 {
    margin-top: 2rem;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Error States */
.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Success States */
.success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
} 