:root {
    --primary-color: #1e3a8a; /* Dark blue */
    --primary-hover: #1e40af;
    --background-color: #f8fafc; /* Light gray section background */
    --card-background: #ffffff; /* White background */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius-base: 12px;
    --border-radius-large: 16px;
    --font-family-base: 'Inter', 'Roboto', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-base);
    color: var(--text-primary);
    background-color: var(--background-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Nav */
header {
    background-color: var(--card-background);
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-menu a {
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--background-color);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    padding-left: 0.5rem;
    color: var(--text-primary);
    font-family: inherit;
}

.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    padding: 4rem 0;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto 3rem auto;
}

/* Calculator Card */
.calculator-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius-large);
    padding: 2.5rem;
    box-shadow: var(--shadow-soft);
    max-width: 500px;
    margin: 0 auto;
    text-align: left;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-base);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background-color: var(--background-color);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--card-background);
}

.btn-primary {
    display: inline-block;
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-base);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(30, 58, 138, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(30, 58, 138, 0.3);
    color: white;
}

.result-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: rgba(30, 58, 138, 0.05);
    border-radius: var(--border-radius-base);
    border-left: 4px solid var(--primary-color);
    display: none; /* Hidden by default */
}

.result-box.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.result-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
}

.result-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Tools Grid */
.tools-section {
    padding: 5rem 0;
    background-color: var(--background-color);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.tool-card {
    background-color: var(--card-background);
    border-radius: var(--border-radius-base);
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-align: left;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.tool-icon {
    width: 48px;
    height: 48px;
    background-color: rgba(30, 58, 138, 0.1);
    color: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.tool-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.tool-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-grow: 1;
}

.tool-link {
    margin-top: 1.5rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Formula Section */
.formula-section {
    padding: 4rem 0;
    background-color: var(--card-background);
}

.formula-box {
    background-color: var(--background-color);
    border-radius: var(--border-radius-base);
    padding: 2rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
}

.formula-display {
    font-family: monospace;
    font-size: 1.5rem;
    color: var(--primary-color);
    background-color: var(--card-background);
    padding: 1rem 2rem;
    border-radius: var(--border-radius-base);
    margin: 1.5rem 0;
    display: inline-block;
    box-shadow: var(--shadow-soft);
}

/* Article Section */
.article-section {
    padding: 5rem 0;
    background-color: var(--card-background);
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
}

.article-content h2 {
    font-size: 2rem;
    margin-top: 2rem;
}

.article-content h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
}

.article-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.article-content li {
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background-color: var(--card-background);
    color: var(--text-secondary);
    padding: 5rem 0 2.5rem 0;
    margin-top: 4rem;
    position: relative;
    border-top: 1px solid var(--border-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3.5rem;
}

.footer-col h4 {
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.footer-col p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.85rem;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    transition: color 0.25s ease, transform 0.25s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: none;
    transform: translateX(4px);
}

.footer-links a::before {
    content: '›';
    font-size: 1.1rem;
    margin-right: 0.4rem;
    opacity: 0;
    width: 0;
    transition: opacity 0.25s ease, width 0.25s ease;
}

.footer-links a:hover::before {
    opacity: 1;
    width: 8px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-bottom p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.875rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: var(--card-background);
        border-top: 1px solid var(--border-color);
        box-shadow: var(--shadow-soft);
        padding: 1.5rem 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        text-align: center;
    }

    .search-bar {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .formula-display {
        font-size: 1.2rem;
        padding: 1rem;
    }

    .article-content h2 {
        font-size: 1.75rem;
    }
}

/* --- CUSTOM ADDITIONS FOR SITE-WIDE UPDATE --- */

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
    font-weight: 500;
}

/* Social Share Buttons */
.social-share-container {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.share-btn {
    padding: 0.5rem 1.25rem;
    border-radius: var(--border-radius-base);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    border: none;
    cursor: pointer;
    color: white !important;
    text-decoration: none !important;
}
.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.share-whatsapp {
    background-color: #25d366;
}
.share-whatsapp:hover {
    background-color: #22c35e;
}
.share-facebook {
    background-color: #1877f2;
}
.share-facebook:hover {
    background-color: #166fe5;
}
.share-copy {
    background-color: #64748b;
}
.share-copy:hover {
    background-color: #475569;
}
.share-copy-toast {
    color: #10b981;
    font-weight: 600;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

/* Feedback Box */
.feedback-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background-color: rgba(30, 58, 138, 0.02);
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius-base);
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.feedback-box p {
    margin: 0;
    font-weight: 600;
    color: var(--text-primary);
}
.btn-feedback {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.9rem;
    border-radius: var(--border-radius-base);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.9rem;
    box-shadow: var(--shadow-soft);
}
.btn-feedback:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}
.feedback-thanks {
    color: #10b981;
    font-weight: 600;
    font-size: 0.9rem;
    animation: fadeIn 0.3s ease;
}

/* Presets for Gewichtete Note & Abiturnote */
.preset-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.btn-preset {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-base);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-soft);
}
.btn-preset:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* Real-time Calculation Highlight Effect */
@keyframes highlight-glow {
    0% {
        box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.2);
        background-color: rgba(30, 58, 138, 0.08);
    }
    100% {
        box-shadow: none;
        background-color: rgba(30, 58, 138, 0.05);
    }
}
.result-box.highlight {
    animation: highlight-glow 0.6s ease-out;
}

/* Extra section style */
.target-grade-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

