/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header and Navigation */
header {
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.95;
    line-height: 1.8;
}

/* Calculator Section */
.calculator-section {
    padding: 3rem 0;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.calculator-inputs,
.calculator-results {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.calculator-inputs h3,
.calculator-results h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

/* Input Groups */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.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);
}

.input-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Quick Terms Buttons */
.quick-terms {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.term-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.term-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.term-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.checkbox-group label {
    cursor: pointer;
    margin: 0;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0.75rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Results Display */
.results-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    color: white;
}

.result-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Chart Container */
.chart-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
}

.chart-container h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

#growthChart {
    max-height: 300px;
    width: 100%;
}

/* Breakdown Table */
.breakdown-table {
    margin-top: 2rem;
}

.breakdown-table h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.breakdown-table table {
    width: 100%;
    border-collapse: collapse;
}

.breakdown-table th,
.breakdown-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.breakdown-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
}

.breakdown-table tr:hover {
    background: var(--bg-light);
}

/* Comparison Section */
.comparison-section {
    padding: 3rem 0;
    background: var(--bg-white);
}

.comparison-section h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--primary-color);
}

.comparison-section > .container > p {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.comparison-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    position: relative;
}

.comparison-card h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.comparison-card .input-group {
    margin-bottom: 1rem;
}

.comparison-card .result {
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.comparison-card .close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--error-color);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

#addComparisonBtn {
    display: block;
    margin: 0 auto;
    width: auto;
    padding: 0.75rem 2rem;
}

/* Info Section */
.info-section {
    padding: 3rem 0;
}

.info-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.info-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.info-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.info-card p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.info-card ul {
    list-style-position: inside;
    color: var(--text-light);
}

.info-card li {
    margin-bottom: 0.5rem;
}

.info-card strong {
    color: var(--text-dark);
}

/* CD Types Section */
.cd-types-section {
    padding: 3rem 0;
    background: var(--bg-white);
}

.cd-types-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary-color);
}

.cd-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.cd-type-card {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
}

.cd-type-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.cd-type-card > p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.pros,
.cons {
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
}

.pros strong {
    color: var(--success-color);
    display: block;
    margin-bottom: 0.5rem;
}

.cons strong {
    color: var(--error-color);
    display: block;
    margin-bottom: 0.5rem;
}

.pros-cons ul {
    list-style-position: inside;
    font-size: 0.875rem;
    color: var(--text-light);
}

.pros-cons li {
    margin-bottom: 0.25rem;
}

/* FAQ Section */
.faq-section {
    padding: 3rem 0;
    background: var(--bg-light);
}

.faq-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary-color);
}

.faq-grid {
    display: grid;
    gap: 1.5rem;
}

.faq-item {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.faq-item h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.faq-item p {
    color: var(--text-light);
    line-height: 1.7;
}

/* Tips Section */
.tips-section {
    padding: 3rem 0;
    background: var(--bg-white);
}

.tips-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary-color);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.tip-card {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    position: relative;
}

.tip-number {
    position: absolute;
    top: -15px;
    left: 20px;
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.tip-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    margin-top: 0.5rem;
    color: var(--text-dark);
}

.tip-card p {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Keywords Section */
.keywords-section {
    padding: 3rem 0;
    background: var(--bg-light);
}

.keywords-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary-color);
}

.keywords-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.keyword-group {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.keyword-group h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.keyword-group ul {
    list-style: none;
}

.keyword-group li {
    padding: 0.5rem 0;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
}

.keyword-group li:last-child {
    border-bottom: none;
}

/* Footer */
footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: white;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    font-size: 0.9rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 968px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .results-display {
        grid-template-columns: 1fr 1fr;
    }

    .nav-menu {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .pros-cons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        width: 100%;
        justify-content: center;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .results-display {
        grid-template-columns: 1fr;
    }

    .quick-terms {
        justify-content: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Print Styles */
@media print {
    header,
    footer,
    .nav-menu,
    .btn-primary,
    .btn-secondary {
        display: none;
    }

    .calculator-grid {
        grid-template-columns: 1fr;
    }

    body {
        background: white;
    }
}

