/* Base Styles and Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Accounts for fixed navbar */
    font-size: 16px;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Global Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

/* Section Spacing */
section {
    padding: 100px 0;
    position: relative;
}

/* Section Header Styles */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #0a1e2c;
    position: relative;
    display: inline-block;
}

.section-header h2:after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -12px;
    transform: translateX(-50%);
    width: 70px;
    height: 3px;
    background: linear-gradient(90deg, #00ff88, #00a1ff);
}

.section-header p {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
    color: #666;
}

/* Common Content Spacing */
p {
    margin-bottom: 1.2rem;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

ul, ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Button Styles */
.btn, .primary-btn, .secondary-btn, .view-all-btn, .course-btn, .btn-learn-more, .submit-btn {
    display: inline-block;
    padding: 12px 28px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    border-radius: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.view-all-btn {
    margin-top: 40px;
    background: linear-gradient(45deg, #00a1ff, #00ff88);
    color: #fff;
    border: none;
    padding: 14px 32px;
    box-shadow: 0 5px 15px rgba(0, 161, 255, 0.3);
}

.view-all-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 161, 255, 0.4);
}

/* Form Elements */
input, select, textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #00a1ff;
    box-shadow: 0 0 0 2px rgba(0, 161, 255, 0.2);
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 30px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Flexbox Layouts */
.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.flex-column {
    flex-direction: column;
}

/* Margin and Padding Utility Classes */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.my-1 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-2 { margin-top: 1rem; margin-bottom: 1rem; }
.my-3 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.my-4 { margin-top: 2rem; margin-bottom: 2rem; }
.my-5 { margin-top: 3rem; margin-bottom: 3rem; }

.mx-auto { margin-left: auto; margin-right: auto; }

.pt-1 { padding-top: 0.5rem; }
.pt-2 { padding-top: 1rem; }
.pt-3 { padding-top: 1.5rem; }
.pt-4 { padding-top: 2rem; }
.pt-5 { padding-top: 3rem; }

.pb-1 { padding-bottom: 0.5rem; }
.pb-2 { padding-bottom: 1rem; }
.pb-3 { padding-bottom: 1.5rem; }
.pb-4 { padding-bottom: 2rem; }
.pb-5 { padding-bottom: 3rem; }

.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }

.px-1 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2 { padding-left: 1rem; padding-right: 1rem; }
.px-3 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-4 { padding-left: 2rem; padding-right: 2rem; }
.px-5 { padding-left: 3rem; padding-right: 3rem; }

/* Responsive Breakpoints */
@media (max-width: 1400px) {
    .container {
        max-width: 1200px;
    }
    
    html {
        font-size: 15px;
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: 1000px;
    }
    
    section {
        padding: 80px 0;
    }
    
    .section-header {
        margin-bottom: 50px;
    }
    
    .section-header h2 {
        font-size: 2.2rem;
    }
    
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }
    
    section {
        padding: 70px 0;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    section {
        padding: 60px 0;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .btn, .primary-btn, .secondary-btn, .view-all-btn, .course-btn, .btn-learn-more, .submit-btn {
        padding: 10px 24px;
        font-size: 0.9rem;
    }
    
    /* Fix responsive layouts for flex containers */
    .flex-md-column {
        flex-direction: column;
    }
    
    .about-content, .contact-container {
        flex-direction: column;
    }
    
    .about-image, .about-text, .contact-form-container, .contact-info-container {
        width: 100%;
        margin-bottom: 30px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }
    
    section {
        padding: 50px 0;
    }
    
    .section-header h2 {
        font-size: 1.6rem;
    }
    
    .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    /* Adjust spacing for smaller screens */
    .mt-sm-3 { margin-top: 1rem; }
    .mb-sm-3 { margin-bottom: 1rem; }
    
    .courses-container, .showcase-gallery, .testimonials-slider {
        margin: 0 -15px;
        padding: 0 15px;
    }
    
    .footer-links {
        flex-direction: column;
    }
    
    .footer-column {
        width: 100%;
        margin-bottom: 30px;
    }
}

/* Fix for Safari/iOS */
@supports (-webkit-touch-callout: none) {
    .flex {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
    }
    
    .grid {
        display: -webkit-grid;
        display: grid;
    }
}

/* Fix for notched phones */
@supports (padding: max(0px)) {
    .container, .main-nav {
        padding-left: max(30px, env(safe-area-inset-left));
        padding-right: max(30px, env(safe-area-inset-right));
    }
    
    @media (max-width: 992px) {
        .container, .main-nav {
            padding-left: max(20px, env(safe-area-inset-left));
            padding-right: max(20px, env(safe-area-inset-right));
        }
    }
    
    @media (max-width: 576px) {
        .container, .main-nav {
            padding-left: max(15px, env(safe-area-inset-left));
            padding-right: max(15px, env(safe-area-inset-right));
        }
    }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Section-specific responsive fixes */
/* About Section */
.about-section .about-content {
    display: flex;
    gap: 40px;
    align-items: center;
}

.about-section .about-text {
    flex: 1;
}

.about-section .about-image {
    flex: 1;
}

.about-features li {
    margin-bottom: 10px;
    list-style-type: none;
    position: relative;
    padding-left: 25px;
}

.about-features li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #00ff88;
    font-weight: bold;
}

/* Courses Section */
.courses-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.course-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.course-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.course-content {
    padding: 25px;
}

.course-features {
    margin: 15px 0;
    padding-left: 0;
    list-style-type: none;
}

.course-features li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.course-features li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: #00a1ff;
    font-weight: bold;
}

/* Gallery Section */
.gallery-placeholder {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    height: 250px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 20px;
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

/* Testimonials Section */
.testimonials-slider {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    padding: 20px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.testimonial-card {
    flex: 0 0 350px;
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    scroll-snap-align: center;
}

.testimonial-author {
    display: flex;
    align-items: center;
    margin-top: 20px;
}

.testimonial-author img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

/* Contact Section */
.contact-container {
    display: flex;
    gap: 40px;
}

.contact-form-container {
    flex: 3;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.contact-info-container {
    flex: 2;
    background: #0a1e2c;
    color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.info-item {
    display: flex;
    margin-bottom: 20px;
}

.info-icon {
    margin-right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 255, 136, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00ff88;
}

/* Footer Section */
.main-footer {
    background: #0a1e2c;
    color: #fff;
    padding: 60px 0 30px;
}

.footer-top {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.footer-logo {
    flex: 1;
    margin-bottom: 30px;
}

.footer-logo img {
    height: 40px;
    margin-right: 20px;
    margin-bottom: 20px;
}

.footer-links {
    flex: 2;
    display: flex;
    flex-wrap: wrap;
}

.footer-column {
    flex: 1;
    min-width: 200px;
    margin-bottom: 20px;
}

.footer-column h3 {
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background: #00ff88;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-column ul li a:hover {
    color: #00ff88;
}

.contact-list li {
    display: flex;
    align-items: center;
}

.contact-list li i {
    margin-right: 10px;
    color: #00ff88;
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom p {
    margin: 0;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: #00ff88;
    color: #0a1e2c;
    transform: translateY(-3px);
}

/* Responsive fixes for specific sections */
@media (max-width: 992px) {
    .courses-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .testimonial-card {
        flex: 0 0 300px;
    }
}

@media (max-width: 768px) {
    .about-section .about-content {
        flex-direction: column;
    }
    
    .about-section .about-image {
        margin-top: 30px;
        order: -1;
    }
    
    .contact-container {
        flex-direction: column;
    }
    
    .contact-info-container {
        margin-top: 30px;
    }
    
    .footer-top {
        flex-direction: column;
    }
    
    .footer-logo {
        text-align: center;
        margin-bottom: 30px;
    }
    
    .footer-links {
        flex-direction: column;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-social {
        margin-top: 20px;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .courses-container {
        grid-template-columns: 1fr;
    }
    
    .gallery-placeholder {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }
    
    .testimonial-card {
        flex: 0 0 100%;
        padding: 20px;
    }
}
