/* 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: #1a202c;
    background-color: #f8fafc;
}

/* Header and Navigation */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #2563eb;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #1a202c;
    transition: 0.3s;
}

/* Main Content */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

.content-area {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Calculator Section */
.calculator-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    border-radius: 16px;
    margin-bottom: 40px;
    text-align: center;
}

.calculator-section h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.calculator-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    background: rgba(255,255,255,0.95);
    color: #1a202c;
    border: 1px solid #d1d5db;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.calculate-btn,
.submit-btn {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.calculate-btn:hover,
.submit-btn:hover {
    background: #d97706;
}

.result-section {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-content {
    text-align: center;
}

.result-date {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.result-details {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Contact Form Styles */
.contact-form-section {
    margin: 30px 0;
}

.contact-form {
    max-width: 600px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

.form-message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.form-message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.contact-info {
    margin: 40px 0;
}

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

.contact-method {
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
}

.contact-method h3 {
    margin-bottom: 10px;
    color: #1a202c;
}

.faq-section {
    margin: 40px 0;
}

.faq-item {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
}

.faq-item h3 {
    margin-bottom: 10px;
    color: #1a202c;
}

/* Article Content */
.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content h1 {
    font-size: 2.5rem;
    color: #1e293b;
    margin-bottom: 30px;
    font-weight: 700;
}

.article-content h2 {
    font-size: 2rem;
    color: #1e293b;
    margin: 30px 0 20px 0;
    font-weight: 600;
}

.article-content h3 {
    font-size: 1.5rem;
    color: #1a202c;
    margin: 25px 0 15px 0;
    font-weight: 600;
}

.article-content p {
    margin-bottom: 20px;
    color: #2d3748;
}

.article-content a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.article-content a:hover {
    text-decoration: underline;
}

.article-content ul,
.article-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.article-content li {
    margin-bottom: 8px;
    color: #2d3748;
}

.highlight-box {
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    padding: 20px;
    margin: 25px 0;
    border-radius: 8px;
}

.quote-box {
    background: #f8fafc;
    border-left: 4px solid #64748b;
    padding: 20px;
    margin: 25px 0;
    font-style: italic;
    border-radius: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    background: #f1f5f9;
    font-weight: 600;
    color: #1a202c;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

/* Related Articles */
.related-articles {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
}

.related-articles h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: #1e293b;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.related-item {
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.related-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.related-item h4 {
    margin-bottom: 10px;
}

.related-item h4 a {
    color: #1e293b;
    text-decoration: none;
    font-weight: 600;
}

.related-item h4 a:hover {
    color: #2563eb;
}

.related-item p {
    font-size: 0.95rem;
    color: #374151;
    margin: 0;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.sidebar-widget h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #1e293b;
    font-weight: 600;
}

.related-links {
    list-style: none;
}

.related-links li {
    margin-bottom: 12px;
}

.related-links a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.related-links a:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

/* Sources Section */
.sources-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
}

.sources-section h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #1e293b;
}

.sources-list {
    list-style: none;
    counter-reset: source-counter;
}

.sources-list li {
    counter-increment: source-counter;
    margin-bottom: 15px;
    padding-left: 30px;
    position: relative;
}

.sources-list li::before {
    content: "[" counter(source-counter) "]";
    position: absolute;
    left: 0;
    color: #2563eb;
    font-weight: 600;
}

/* Footer */
.footer {
    background: #1e293b;
    color: #cbd5e1;
    padding: 40px 0 20px 0;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h4 {
    color: #fff;
    margin-bottom: 15px;
    font-weight: 600;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

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

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid #334155;
    color: #cbd5e1;
}

/* GDPR Banner */
.gdpr-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #1e293b;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    max-width: 350px;
    font-size: 0.9rem;
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: none;
}

.gdpr-banner.show {
    display: block;
}

.gdpr-banner p {
    margin-bottom: 10px;
}

.gdpr-actions {
    display: flex;
    gap: 10px;
}

.gdpr-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}

.gdpr-accept {
    background: #22c55e;
    color: white;
}

.gdpr-decline {
    background: #6b7280;
    color: white;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #2563eb;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
}

.back-to-top.show {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .main-container {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px;
    }

    .content-area {
        padding: 20px;
    }

    .calculator-section {
        padding: 30px 20px;
    }

    .calculator-section h1 {
        font-size: 2rem;
    }

    .article-content h1 {
        font-size: 2rem;
    }

    .article-content h2 {
        font-size: 1.6rem;
    }

    .result-date {
        font-size: 1.5rem;
    }

    .gdpr-banner {
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .contact-methods {
        grid-template-columns: 1fr;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 0.9rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .calculator-form {
        max-width: 100%;
    }

    .calculator-section h1 {
        font-size: 1.8rem;
    }

    .article-content h1 {
        font-size: 1.8rem;
    }

    .article-content h2 {
        font-size: 1.4rem;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .nav-container {
        padding: 0 15px;
    }

    .main-container {
        padding: 15px;
    }

    .content-area {
        padding: 15px;
    }

    .calculator-section {
        padding: 20px 15px;
    }

    .sidebar-widget {
        padding: 20px;
    }
}

/* Print Styles */
@media print {
    .header,
    .sidebar,
    .footer,
    .gdpr-banner,
    .back-to-top,
    .calculator-section {
        display: none;
    }

    .main-container {
        grid-template-columns: 1fr;
        padding: 0;
        max-width: none;
    }

    .content-area {
        box-shadow: none;
        padding: 0;
    }

    .article-content {
        font-size: 12pt;
        line-height: 1.5;
    }

    .article-content h1 {
        font-size: 18pt;
    }

    .article-content h2 {
        font-size: 16pt;
    }

    .article-content h3 {
        font-size: 14pt;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    body {
        color: #000000;
    }
    
    .article-content p,
    .article-content li {
        color: #000000;
    }
    
    .nav-menu a {
        color: #000000;
    }
    
    .highlight-box {
        border-left-width: 6px;
        background: #ffffff;
        color: #000000;
        border: 2px solid #000000;
    }

    .quote-box {
        border-left-width: 6px;
        background: #ffffff;
        color: #000000;
        border: 2px solid #000000;
    }

    .related-item:hover {
        border-width: 2px;
        border-color: #000000;
    }
    
    .data-table th {
        color: #000000;
        background: #ffffff;
        border: 1px solid #000000;
    }
    
    .data-table td {
        border: 1px solid #000000;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0f172a;
        color: #e2e8f0;
    }

    .header {
        background: #1e293b;
    }

    .content-area,
    .sidebar-widget,
    .related-item,
    .faq-item,
    .contact-method {
        background: #1e293b;
        color: #e2e8f0;
    }

    .data-table {
        background: #1e293b;
    }

    .data-table th {
        background: #334155;
    }

    .highlight-box {
        background: #1e3a8a;
        color: #dbeafe;
    }

    .quote-box {
        background: #374151;
        color: #d1d5db;
    }
}

/* Text Visibility and Accessibility Improvements */
.calculator-section {
    /* Ensure white text has sufficient contrast against gradient */
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Improve focus states for accessibility */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-color: #2563eb;
}

.calculate-btn:focus,
.submit-btn:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.nav-menu a:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Better link visibility */
.article-content a {
    color: #1d4ed8;
    text-decoration: underline;
    text-decoration-color: rgba(29, 78, 216, 0.3);
    font-weight: 600;
}

.article-content a:hover {
    text-decoration-color: #1d4ed8;
    background-color: rgba(29, 78, 216, 0.05);
    padding: 2px 4px;
    border-radius: 4px;
    margin: -2px -4px;
}

/* Ensure button text is highly visible */
.calculate-btn,
.submit-btn,
.gdpr-btn {
    font-weight: 600;
    text-shadow: none;
}

/* Improve table readability */
.data-table td {
    color: #1a202c;
}

/* Better contrast for form labels */
.form-group label {
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Enhanced sidebar text visibility */
.sidebar-widget h3 {
    color: #1a202c;
    font-weight: 600;
}

.related-links a:hover {
    color: #1d4ed8;
}

/* Better footer text contrast */
.footer-links a {
    color: #e2e8f0;
}
