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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #60a5fa;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --gray: #6b7280;
    --light: #f3f4f6;
    --white: #ffffff;
    --bg: #ffffff;
    --text: #1f2937;
    --border: #e5e7eb;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --text: #e2e8f0;
    --border: #334155;
    --light: #1e293b;
    --dark: #cbd5e1;
    --white: #0f172a;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    transition: var(--transition);
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Header */
.header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 700;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text);
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-menu a:hover {
    background: var(--light);
    color: var(--primary);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    list-style: none;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text);
}

.dropdown-menu a:hover {
    background: var(--light);
}

.dropdown-toggle::after {
    content: "▼";
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: var(--radius);
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: var(--radius);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--light);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

/* Quick Calculator */
.quick-calc {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: var(--radius);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.calc-input {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem;
    font-size: 1.125rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.95);
    color: var(--dark);
}

.calc-input:focus {
    outline: none;
    border-color: white;
    background: white;
}

.btn-primary {
    background: white;
    color: var(--primary);
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.quick-result {
    width: 100%;
    padding: 1rem;
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--dark);
    border-radius: var(--radius);
    font-size: 1.5rem;
    font-weight: 700;
    min-height: 50px;
    display: none;
}

.quick-result.show {
    display: block;
}

/* Main Content */
.main-content {
    padding: 3rem 0;
}

/* Tools Section */
.tools-section {
    margin-bottom: 3rem;
}

.tools-section h2 {
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text);
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tool-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: var(--transition);
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.tool-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.tool-card h3 {
    margin-bottom: 0.5rem;
}

.tool-card h3 a {
    color: var(--text);
}

.tool-card p {
    color: var(--gray);
    font-size: 0.95rem;
    margin: 0;
}

/* SEO Content */
.seo-content {
    margin-top: 4rem;
    padding: 2rem;
    background: var(--light);
    border-radius: var(--radius);
}

.seo-content h2 {
    margin-bottom: 1.5rem;
}

.seo-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

/* Calculator Styles */
.calculator {
    max-width: 400px;
    margin: 2rem auto;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.calc-display {
    background: var(--light);
    padding: 1rem;
    font-size: 2rem;
    text-align: right;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    min-height: 60px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.calc-btn {
    padding: 1.25rem;
    font-size: 1.25rem;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.calc-btn:hover {
    background: var(--light);
}

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

.calc-btn.operator {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
}

.calc-btn.operator:hover {
    background: var(--primary-dark);
}

.calc-btn.equals {
    background: var(--secondary);
    color: white;
    grid-column: span 2;
}

.calc-btn.clear {
    background: var(--danger);
    color: white;
}

.calc-btn.zero {
    grid-column: span 2;
}

/* Converter Styles */
.converter {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.converter-group {
    margin-bottom: 1.5rem;
}

.converter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.converter-input,
.converter-select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    transition: var(--transition);
}

.converter-input:focus,
.converter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.converter-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: end;
}

.swap-btn {
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.25rem;
    transition: var(--transition);
    margin-bottom: 0;
    align-self: center;
}

.swap-btn:hover {
    background: var(--primary-dark);
    transform: rotate(180deg);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Results */
.result-box {
    padding: 1.5rem;
    background: var(--light);
    border-radius: var(--radius);
    margin-top: 1.5rem;
}

.result-box h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.result-item:last-child {
    border-bottom: none;
}

.result-value {
    font-weight: 700;
    color: var(--primary);
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--light);
    font-weight: 600;
    color: var(--text);
}

.data-table tr:hover {
    background: var(--light);
}

/* Footer */
.footer {
    background: var(--light);
    border-top: 1px solid var(--border);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

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

.footer-column h4 {
    margin-bottom: 1rem;
    color: var(--text);
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: var(--gray);
}

.footer-column a:hover {
    color: var(--primary);
}

.copyright {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--gray);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #059669;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg);
        border-top: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem;
    }

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

    .menu-toggle {
        display: block;
    }

    .dropdown-menu {
        position: static;
        display: block;
        box-shadow: none;
        border: none;
        padding-left: 1rem;
    }

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

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

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

    .calc-buttons {
        gap: 0.25rem;
    }

    .calc-btn {
        padding: 1rem;
        font-size: 1.125rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .nav-menu,
    .theme-toggle,
    .menu-toggle {
        display: none;
    }

    body {
        color: black;
        background: white;
    }

    .container {
        max-width: 100%;
    }
}

/* ======================================================================
   Content Pages (Legal, About, Contact)
   ====================================================================== */

/* Page Header */
.page-header {
    text-align: center;
    padding: 3rem 0 2rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 2rem;
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-header .lead {
    font-size: 1.25rem;
    color: var(--gray);
    margin-bottom: 0.5rem;
}

.page-header .last-updated {
    font-size: 0.875rem;
    color: var(--gray);
    font-style: italic;
}

/* Content Page */
.content-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.content-section {
    margin-bottom: 3rem;
}

.content-section h2 {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    margin-top: 2rem;
}

.content-section h3 {
    color: var(--text);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.content-section h4 {
    color: var(--text);
    margin-top: 1rem;
    margin-bottom: 0.75rem;
}

.content-section ul,
.content-section ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.content-section li {
    margin-bottom: 0.5rem;
}

.content-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* Legal Page Specific */
.legal-page .legal-list {
    list-style: none;
    margin-left: 0;
}

.legal-page .legal-list li {
    padding-left: 0;
    margin-bottom: 0.5rem;
}

.legal-footer {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--light);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.privacy-intro {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    margin-bottom: 2rem;
}

.cookies-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.cookies-table th,
.cookies-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.cookies-table th {
    background: var(--light);
    font-weight: 600;
    color: var(--text);
}

.cookies-table tbody tr:hover {
    background: var(--light);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
}

.cta-section h2 {
    color: white;
    border: none;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.9);
}

.cta-section .btn-link {
    color: white;
    text-decoration: underline;
    font-weight: 600;
}

.cta-section .btn-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* ======================================================================
   Contact Page
   ====================================================================== */

.contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

/* Contact Form */
.contact-form-section {
    background: var(--white);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.required {
    color: var(--danger);
}

.form-control {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg);
    color: var(--text);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.25rem;
    cursor: pointer;
}

.checkbox-label span {
    flex: 1;
}

.form-message {
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
}

.form-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.form-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid var(--danger);
}

/* Contact Info */
.contact-info-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-card {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.info-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary);
}

.info-item {
    margin-bottom: 1rem;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.info-item p {
    margin: 0;
    color: var(--gray);
}

.faq-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

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

.faq-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.faq-item p {
    margin: 0;
    color: var(--gray);
    font-size: 0.9375rem;
}

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

.method-card {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.method-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.method-card h3 {
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.method-card p {
    margin-bottom: 0.5rem;
    color: var(--gray);
}

.method-card a {
    color: var(--primary);
    font-weight: 600;
}

/* Active Nav Link */
.nav-menu a.active {
    color: var(--primary);
    font-weight: 600;
}

/* ======================================================================
   Responsive Design for New Pages
   ====================================================================== */

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .page-header {
        padding: 2rem 0 1.5rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header .lead {
        font-size: 1.125rem;
    }

    .content-section ul,
    .content-section ol {
        margin-left: 1.5rem;
    }

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

    .cookies-table {
        font-size: 0.875rem;
    }

    .cookies-table th,
    .cookies-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .info-card {
        padding: 1rem;
    }

    .method-card {
        padding: 1rem;
    }

    .legal-footer {
        padding: 1rem;
    }

    .privacy-intro {
        padding: 1rem;
    }
}