:root {
    --primary-dark: #2a2828;
    --primary-light: #ececec;
    --accent-red: #cd2525;
    --section-padding: 2rem;
    --border-radius: 8px;
    
    /* Typography */
    --font-size-base: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-3xl: 2.5rem;
}

/* Text sizing classes */
.text-base {
    font-size: var(--font-size-base);
}

.text-lg {
    font-size: var(--font-size-lg);
}

.text-xl {
    font-size: var(--font-size-xl);
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--primary-dark);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Add these new styles */
body.menu-open {
    overflow: hidden;
}

header {
    background-color: #0b0b0b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 150; /* Decreased to be below article header */
}

main {
    flex: 1;
    width: 80vw;
    max-width: 1200px;
    margin: 0 auto;
    color: var(--primary-light);
    padding: var(--section-padding) 0;
    font-size: var(--font-size-lg);
}

main section {
    background: rgba(255, 255, 255, 0.05);
    padding: var(--section-padding);
    margin: 2rem 0;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

main h1 {
    color: var(--accent-red);
    margin: 0 0 1.5rem 0; /* Changed from margin-bottom only */
    font-size: var(--font-size-3xl);
    border-bottom: 2px solid var(--accent-red);
    padding-bottom: 0.5rem;
}

main a {
    color: var(--primary-light);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-red);
    transition: color 0.3s;
}

main a:hover {
    color: var(--accent-red);
}

nav {
    margin: .5em;
    display: flex;
    align-items: center;
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    font-size: var(--font-size-2xl);
    display: flex;
    align-items: center;
    z-index: 100; /* Lower than article header */
}

nav ul li {
    margin: 0 .5em;
}

nav ul li a {
    text-decoration: none;
    color: #ececec;
    font-weight: bold;
    display: inline-block;
    text-transform: uppercase;
    transition: opacity 0.3s ease;
}

.hover-underline {
    font-size: var(--font-size-2xl);
    color: #ffffff;
    position: relative;
    display: inline-block;
}

.hover-underline::after,
.hover-underline::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, #cd2525, #00ffff);
    bottom: -5px;
    left: 0;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease-out;
}

.hover-underline::before {
    top: -5px;
    transform-origin: left;
}

.hover-underline:hover::after,
.hover-underline:hover::before {
    transform: scaleX(1);
}

nav img {
    height: 8em;
    margin: 0 1em;
}

#logo {
    margin-right: auto;
}

footer {
    background-color: #0b0b0b;
    padding: var(--section-padding);
    margin-top: auto;
    text-align: center;
    color: var(--primary-light);
}

#social_media {
    margin-bottom: 1rem;
}

#social_media a {
    margin: 0 1rem;
    opacity: 0.8;
    transition: opacity 0.3s;
}

#social_media a:hover {
    opacity: 1;
}

form {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.08);
    padding: 2rem;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    box-sizing: border-box;
}

form label,
form input,
form textarea,
form button {
    margin: 0.5em 0;
}

form input,
form textarea {
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--primary-light);
    box-sizing: border-box;
}

form button {
    background: var(--accent-red);
    color: var(--primary-light);
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

form button:hover {
    background-color: #a61d1d;
}

#contact_form {
    width: min(600px, 90%);
    margin: 2rem auto;
    font-size: var(--font-size-base);
}

#services_list {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#services_list ul {
    list-style: none;
    padding: 0;
}

#services_list li {
    padding: 1rem;
    margin: 1rem 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-red);
    font-size: inherit;
}

#calendar {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #3a3a3a; /* Change to white background */
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: inherit;
}

#calendar iframe {
    background: #ffffff;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#welcome_message,
#about_us,
#testimonials {
    font-size: inherit;
}

.testimonials {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary-light);
    margin: 1.5rem 0;
    padding: 2rem;
    border-radius: var(--border-radius);
    position: relative;
    border-left: 4px solid var(--accent-red);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: inherit;
}

/* Carousel Styling */
#services_carousel {
    background: rgba(255, 255, 255, 0.05);
    padding: var(--section-padding);
    margin: 2rem 0;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}

.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin: 0 auto;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.carousel-slide {
    min-width: 100%;
    flex: 0 0 100%;
    padding: 1rem 6rem 2rem 6rem;
    box-sizing: border-box;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-red); /* Add border to match testimonials */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); /* Add shadow to match testimonials */
}

.carousel-slide h2 {
    color: #ffffff;
    margin: 0 0 1rem 0;
    font-size: var(--font-size-2xl);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: relative;
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.carousel-slide h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;  /* Changed from 50% to 70% for a longer underline */
    height: 2px;
    background-color: #ff0000;
}

/* Override the general h2 styling for carousel slides */
#services_carousel .carousel-slide h2::after {
    left: 50%;
    transform: translateX(-50%);
    width: 90%; /* Increased from 70% to 90% for an even longer underline */
    background-color: #ff0000;
}

.carousel-slide p {
    max-width: 800px;
    margin: 0 auto;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent-red);
    color: var(--primary-light);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    opacity: 0.8;
    transition: opacity 0.3s;
    font-size: var(--font-size-xl);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-button:hover {
    opacity: 1;
}

.carousel-button.prev {
    left: 1rem;
}

.carousel-button.next {
    right: 1rem;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    gap: 0.5rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-light);
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.3s;
}

.dot.active {
    opacity: 1;
    background: var(--accent-red);
}

/* Instructor Profile Styling */
.instructor-profile {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-cyan);
}

.instructor-profile img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-cyan);
}

.instructor-info {
    flex: 1;
}

.instructor-info h2 {
    color: #ffffff;
    margin: 0 0 1rem 0;
    font-size: var(--font-size-2xl);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Qualification Section Styling */
.qualification-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 2rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-red);
}

.qualification-image {
    flex: 0 0 400px;
}

.qualification-image img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.qualification-details {
    flex: 1;
}

.qualification-details h2 {
    color: #ffffff;
    margin-bottom: 1rem;
    font-size: var(--font-size-xl);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.qualification-details ul {
    list-style-type: none;
    padding: 0;
}

.qualification-details li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
}

.qualification-details li::before {
    content: "•";
    color: var(--accent-red);
    position: absolute;
    left: 0;
}

.important-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(205, 37, 37, 0.1);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-red);
}

/* Media query for responsive layout */
@media (max-width: 768px) {
    .qualification-container {
        flex-direction: column;
    }
    
    .qualification-image {
        flex: 0 0 auto;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    main {
        width: 90vw;
    }

    .carousel-slide {
        padding: 1rem 3rem;
    }
}

@media (max-width: 768px) {
    /* Navigation */
    nav {
        flex-direction: column;
        padding: 0;
        gap: 1rem;
    }

    #logo {
        margin: 0 auto;
        flex-shrink: 0;
    }

    nav img {
        height: 8em; /* Keep same height as desktop */
        margin: 0; /* Remove margin to help with centering */
    }

    .hamburger {
        position: fixed; /* Changed from absolute to fixed */
        top: 2rem;
        right: 1rem;
        z-index: 1002; /* Increased from 1000 to be above the mobile menu */
    }

    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        background: rgba(11, 11, 11, 0.95);
        flex-direction: column;
        justify-content: center;
        transition: right 0.3s ease;
        backdrop-filter: blur(8px);
        margin: 0;
        padding: 2rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 1001; /* Ensure this is lower than the hamburger button */
    }

    nav.active ul {
        right: 0;
    }

    /* Logo */
    #logo img {
        height: 6em;
    }

    /* Main content */
    main {
        padding: var(--section-padding) 1rem;
    }

    /* Text sizes */
    .text-lg {
        font-size: var(--font-size-base);
    }

    .text-xl {
        font-size: var(--font-size-lg);
    }

    main h1 {
        font-size: var(--font-size-2xl);
    }

    /* Carousel */
    .carousel-slide {
        padding: 1rem;
    }

    .carousel-button {
        width: 30px;
        height: 30px;
        font-size: var(--font-size-base);
    }

    /* Instructor profile */
    .instructor-profile {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .instructor-info h2 {
        font-size: var(--font-size-xl);
    }

    /* Forms */
    form {
        padding: 1rem;
    }

    form input,
    form textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Social media footer */
    #social_media {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }

    #social_media a {
        margin: 0;
    }
}

@media (max-width: 480px) {
    /* Further adjustments for very small screens */
    main h1 {
        font-size: var(--font-size-xl);
    }

    .qualification-image {
        flex: 0 0 100%;
    }

    .carousel-slide h2 {
        font-size: var(--font-size-lg);
    }

    .carousel-slide p {
        font-size: var(--font-size-base);
    }

    /* Stack testimonials tighter */
    .testimonials {
        padding: 1rem;
        margin: 1rem 0;
    }

    /* Adjust calendar height for mobile */
    #calendar iframe {
        height: 400px;
    }
}

/* Improve tap targets on mobile */
@media (hover: none) {
    nav ul li a,
    .carousel-button,
    form button,
    #social_media a {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Hamburger Menu Styles */
.hamburger {
    display: none;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: none;
    z-index: 1002; /* Increased from 1000 to be above the mobile menu */
    position: fixed; /* Changed from absolute to fixed */
    top: 2rem;
    right: 1rem;
}

.hamburger span {
    display: block;
    width: 30px;
    height: 3px;
    margin: 5px 0;
    background: var(--primary-light);
    transition: transform 0.3s, opacity 0.3s;
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    nav {
        position: relative;
    }

    nav ul {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        background: rgba(11, 11, 11, 0.95);
        flex-direction: column;
        justify-content: center;
        transition: right 0.3s ease;
        backdrop-filter: blur(8px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 201; /* Above article header but below hamburger */
    }

    nav.active ul {
        right: 0;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }
}

/* Resources Page Styles */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.resource-category {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border-left: 4px solid var(--accent-red);
}

.resource-category h2 {
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-size: var(--font-size-xl);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.resource-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resource-list li {
    margin-bottom: 1.5rem;
}

.resource-link {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius);
    transition: transform 0.3s ease, background-color 0.3s ease;
    border: none !important;
}

.resource-link:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.12);
}

.link-title {
    font-weight: bold;
    color: #ffffff;
    font-size: var(--font-size-lg);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    position: relative;
    padding-bottom: 0.25rem;
}

.link-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent-red);
}

.resource-link:hover .link-title {
    color: var(--accent-red);
    text-shadow: 2px 2px 4px rgb(0, 0, 0);
}

.link-description {
    color: var(--primary-light);
    font-size: var(--font-size-base);
    opacity: 0.9;
}

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

    .resource-category {
        padding: 1rem;
    }
}

/* Update h2 styling across all sections */
.resource-category h2,
.carousel-slide h2,
.qualification-details h2,
.instructor-info h2 {
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-size: var(--font-size-xl);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    position: relative;
    padding-bottom: 0.5rem;
}

.resource-category h2::after,
.carousel-slide h2::after,
.qualification-details h2::after,
.instructor-info h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent-red);
}

/* Article Styles */
.article-content {
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 2rem;
    background: rgba(11, 11, 11, 0.95); /* Darker background to match nav */
    position: sticky;
    top: 0;
    z-index: 200;
    padding: 0 2rem; /* Removed top/bottom padding */
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* Added shadow for depth */
    backdrop-filter: blur(8px); /* Adds glass effect */
    min-height: calc(8em + 1rem); /* Match nav height (logo height + margin) */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
}

.article-header h1 {
    margin-bottom: 0.5rem; /* Reduced spacing for vertical centering */
    font-size: var(--font-size-2xl);
    line-height: 1.2;
    letter-spacing: 0.5px; /* Improved readability */
}

.article-meta {
    display: flex;
    gap: 2rem; /* Increased spacing between meta items */
    color: var(--primary-light);
    opacity: 0.9; /* Increased visibility */
    font-size: var(--font-size-base);
    flex-wrap: wrap;
    padding: 0.5rem 0; /* Added vertical padding */
}

.article-intro {
    font-size: var(--font-size-lg);
    border-left: 4px solid var(--accent-red);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
}

.article-body h2 {
    color: #ffffff;
    font-size: var(--font-size-xl);
    margin: 2rem 0 1rem;
    border-bottom: 2px solid var(--accent-red);
    padding-bottom: 0.5rem;
}

.article-callout {
    background: rgba(205, 37, 37, 0.1);
    border-left: 4px solid var(--accent-red);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: var(--border-radius);
}

.article-callout h3 {
    color: var(--accent-red);
    margin: 0 0 1rem 0;
}

.article-image {
    margin: 2rem 0;
}

.article-image img {
    width: 100%;
    border-radius: var(--border-radius);
}

.article-image figcaption {
    text-align: center;
    font-size: var(--font-size-base);
    color: var(--primary-light);
    opacity: 0.8;
    margin-top: 0.5rem;
}

.article-conclusion {
    margin: 3rem 0;
}

.article-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.article-tags {
    margin-bottom: 2rem;
}

.tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    margin: 0.2rem;
    font-size: var(--font-size-base);
}

.article-share h3 {
    color: var(--primary-light);
    font-size: var(--font-size-lg);
    margin-bottom: 1rem;
}

/* Article Responsive Adjustments */
@media (max-width: 768px) {
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .article-callout {
        margin: 1.5rem 0;
        padding: 1rem;
    }

    .article-header {
        padding: 1rem; /* Smaller padding on mobile */
        min-height: unset; /* Remove fixed height on mobile */
    }
    
    .article-meta {
        gap: 1rem;
    }
}

nav.menu-fade ul li a {
    opacity: 0;
}