body {

    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.section-card {
    background-color: #1A1A1A; /* Darker gray for cards */
    border: 1px solid #262626; /* Subtle dark gray border */
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.btn-primary {
    background-color: #FF4D6D; /* Brighter, more vibrant red */
    color: white;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border-radius: 9999px;
    padding: 0.85rem 2.25rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    box-shadow: 0 4px 10px rgba(255, 77, 109, 0.4);
}
.btn-primary:hover {
    background-color: #E03C59; /* Darker Red on hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 77, 109, 0.6);
}
.btn-secondary {
    background-color: #262626; /* Muted Dark Gray for secondary button */
    color: #C0C0C0; /* Softer white */
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    border-radius: 9999px;
    padding: 0.85rem 2.25rem;
    border: 1px solid #333333; /* Consistent darker border */
    font-weight: 500;
    letter-spacing: 0.01em;
}
.btn-secondary:hover {
    background-color: #333333; /* Lighter hover for secondary */
    color: #E2E8F0;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.navbar-link {
    color: #A0A0A0; /* Softer text color for nav */
    transition: color 0.2s, background-color 0.2s;
    padding: 0.5rem 0.9rem;
    border-radius: 0.5rem;
    font-weight: 500;
}
.navbar-link:hover {
    color: #FF4D6D; /* Accent color on hover */
    background-color: #1A1A1A; /* Subtle background on hover */
}

/* Mobile Menu Specific Styles */
.mathcravehelper-mobile-menu-overlay { /* Namespaced class */
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Darker overlay */
    backdrop-filter: blur(5px); /* Subtle blur effect */
    z-index: 999;
    display: flex;
    justify-content: flex-end;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.4s ease-out, opacity 0.4s ease-out;
}

.mathcravehelper-mobile-menu-overlay.active { /* Namespaced class */
    visibility: visible;
    opacity: 1;
}

.mathcravehelper-mobile-menu-content { /* Namespaced class */
    background-color: #1A1A1A; /* Matches general card background */
    width: 80%;
    max-width: 350px;
    height: 100%;
    padding: 2.5rem;
    box-shadow: -8px 0 20px rgba(0, 0, 0, 0.6);
    transform: translateX(100%);
    transition: transform 0.4s ease-out;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    border-left: 1px solid #262626;
}

.mathcravehelper-mobile-menu-overlay.active .mathcravehelper-mobile-menu-content { /* Namespaced class */
    transform: translateX(0);
}


.nav-links-desktop {
    display: none;
}

@media (min-width: 768px) {
    .nav-links-desktop {
        display: flex;
        position: static;
        background-color: transparent;
        width: auto;
        height: auto;
        padding: 0;
        box-shadow: none;
        transform: none;
        flex-direction: row;
        align-items: center;
    }
    .hamburger-menu {
        display: none;
    }
}

/* KaTeX specific styling to ensure text contrast */
.katex {
    color: inherit;
}
.katex-display {
    overflow-x: auto;
    padding: 0.5rem 0;
    margin-top: 0.5rem; /* Spacing for block math */
    margin-bottom: 0.5rem;
}

/* Specific styles for Help Center page */
.help-section-heading {
    font-size: 2.5rem;
    font-weight: 700;
    color: #E2E8F0; /* White for main headings */
    text-align: center;
    margin-bottom: 2.5rem;
}
.contact-form-card {
    background-color: #1A1A1A;
    border: 1px solid #262626;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}
.contact-form-card label {
    display: block;
    font-size: 0.9rem;
    color: #C0C0C0;
    margin-bottom: 0.5rem;
    text-align: left;
}
.contact-form-card input[type="text"],
.contact-form-card input[type="email"],
.contact-form-card textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1.25rem;
    background-color: #0F0F0F;
    border: 1px solid #333333;
    border-radius: 0.5rem;
    color: #E2E8F0;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.contact-form-card input[type="text"]:focus,
.contact-form-card input[type="email"]:focus,
.contact-form-card textarea:focus {
    border-color: #FF4D6D;
    box-shadow: 0 0 0 2px rgba(255, 77, 109, 0.3);
}
.contact-form-card textarea {
    min-height: 120px;
    resize: vertical;
}
.contact-form-card button {
    width: auto;
    padding: 0.75rem 2rem;
    margin-top: 1rem;
}
.faq-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #262626;
}
.faq-item {
    background-color: #1A1A1A;
    border: 1px solid #262626;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.faq-item h4 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #E2E8F0;
    margin-bottom: 0.5rem;
}
.faq-item p {
    font-size: 0.95rem;
    color: #A0A0A0;
    line-height: 1.6;
}

/* Modal Styles */
.mathcravehelper-modal-overlay { /* Updated class */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mathcravehelper-modal-overlay.active { /* Updated class */
    opacity: 1;
    visibility: visible;
}
.mathcravehelper-modal-content { /* Updated class */
    background-color: #1A1A1A;
    padding: 2.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    position: relative;
    border: 1px solid #262626;
}
.mathcravehelper-modal-overlay.active .mathcravehelper-modal-content { /* Updated class */
    transform: translateY(0);
}
.mathcravehelper-modal-content h3 { /* Updated class */
    font-size: 1.75rem;
    font-weight: 600;
    color: #6EE7B7; /* Green for success */
    margin-bottom: 1rem;
}
.mathcravehelper-modal-content p { /* Updated class */
    color: #C0C0C0;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}
.mathcravehelper-modal-close-button { /* Updated class */
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #A0A0A0;
    cursor: pointer;
    transition: color 0.2s;
}
.mathcravehelper-modal-close-button:hover { /* Updated class */
    color: #E2E8F0;
}
/* Loading spinner */
.loader {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid #FF4D6D; /* MathCrave accent color */
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}