:root {
    --primary-color: #0076ff;
    --background-color: #ffffff;
    --surface-color: #ffffff;
    --text-color: #333333;
    --secondary-text: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    --border-radius: 12px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode {
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #e0e0e0;
    --secondary-text: #b0b0b0;
    --border-color: #333333;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 40px 20px;
    transition: background-color 0.3s, color 0.3s;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.description {
    color: var(--secondary-text);
    font-size: 1.1rem;
}

.card {
    background: var(--surface-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    animation: fadeIn 0.5s ease-out;
}

/* Main Navigation */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.main-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1.1rem;
    transition: color 0.3s ease, border-bottom 0.3s ease;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.main-nav a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-btn:hover {
    background: var(--border-color);
}

/* Search & Filters */
.controls {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: fadeIn 0.4s ease-out;
}

.search-box {
    position: relative;
}

.search-box input {
    padding-left: 40px;
    background: var(--surface-color);
    color: var(--text-color);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-text);
}

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 14px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.nav-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.nav-link:hover {
    text-decoration: underline;
}

.calc-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
}

input,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    background: var(--surface-color);
    color: var(--text-color);
}

input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 118, 255, 0.2);
}

button {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

button:hover {
    background-color: #0060d0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 96, 208, 0.3);
}

.ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.result {
    margin-top: 24px;
    padding: 20px;
    background-color: #f0f7ff;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.result h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.result-value {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Home Grid */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.home-card {
    background: var(--surface-color);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    border: 1px solid var(--border-color);
}

.home-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary-color);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

.home-card h2 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-color);
    transition: var(--transition);
}

.home-card:hover h2 {
    color: var(--primary-color);
}

.home-card p {
    font-size: 0.85rem;
    color: var(--secondary-text);
    margin: 0;
}

.tag {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tag.new {
    background: #4caf50;
    color: white;
}

.tag.popular {
    background: #ff9800;
    color: white;
}

.highlight {
    background: rgba(255, 235, 59, 0.4);
    padding: 0 2px;
    border-radius: 2px;
}

@media (max-width: 600px) {
    body {
        padding: 20px 15px;
    }

    .card {
        padding: 20px;
    }
}

/* Footer Styles */
.site-footer {
    margin-top: 60px;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--secondary-text);
}

.footer-links {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

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

.footer-note {
    font-size: 0.8rem;
    margin-top: 10px;
}

/* Cookie Banner */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 15px 20px;
    display: none;
    justify-content: space-between;
    align-items: center;
    z-index: 2000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

#cookie-banner p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-color);
}

.cookie-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    width: auto !important;
}

.cookie-btn:hover {
    background: #0060d0;
}

/* Content & FAQ Polishing */
.content-section {
    margin-top: 40px;
    line-height: 1.6;
}

.content-section h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.content-section p {
    margin-bottom: 20px;
    /* Blank line between paragraphs */
}

.faq {
    margin-top: 30px;
    /* 30px gap between content and FAQs */
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
}

.faq h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.faq h3 {
    margin: 25px 0 10px;
    font-size: 1.1rem;
    color: var(--text-color);
}

.faq p {
    margin-bottom: 15px;
    color: var(--secondary-text);
}

/* Blog Article Polish */
article.card h2 {
    margin: 40px 0 20px;
    color: var(--primary-color);
}

article.card p {
    margin-bottom: 25px;
    line-height: 1.8;
}

article.card ul,
article.card ol {
    margin-bottom: 25px;
    padding-left: 20px;
}

article.card li {
    margin-bottom: 10px;
}