/* === MyCADSystem Master Stylesheet === */

/* --- 1. GLOBAL STYLES & SETUP --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Titillium+Web:wght@600;700&display=swap');

:root {
    --primary-color: #005A9C; /* Professional Blue */
    --secondary-color: #00A4E4; /* Lighter Blue */
    --accent-color: #FDB813; /* Yellow Accent */
    --dark-color: #2C3E50;
    --light-color: #ECF0F1;
    --text-color: #34495E;
    --white-color: #FFFFFF;
    --success-color: #2ECC71;
    --error-color: #E74C3C;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white-color);
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 0 2rem;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

h1, h2, h3 {
    font-family: 'Titillium Web', sans-serif;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

/* --- 2. REUSABLE COMPONENTS --- */

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}
.btn-primary {
    background-color: var(--primary-color);
    color: var(--white-color);
}
.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}
.btn-accent {
    background-color: var(--accent-color);
    color: var(--dark-color);
}
.btn-accent:hover {
     background-color: #ffc94a;
     transform: translateY(-3px);
}

/* Generic Card */
.card {
    background: var(--white-color);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}
.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}
.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.card-body h3 {
    margin-top: 0;
}
.card-body .btn {
    margin-top: auto;
    align-self: flex-start;
}

/* ===================================
   HEADER STYLES (DEFINITIVE FIX)
   =================================== */

/* --- Main Header Styling --- */
.main-header {
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000; /* Header stays on top of content */
    width: 100%;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px; /* Set a fixed height for consistency */
    padding: 0 25px;
}

/* --- Logo & Desktop Nav --- */
.logo img {
    height: 40px;
    width: auto;
    display: block;
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}
.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

/* --- Mobile Menu Button (Initially Hidden) --- */
.menu-toggle {
    display: none;
}


/* ===================================
   RESPONSIVE STYLES (TABLET & MOBILE)
   =================================== */
@media (max-width: 992px) {

    /* --- Hide the desktop navigation links --- */
    .main-nav ul {
        display: none;
    }
    .header-buttons {
        display: none;
    }
    
    /* --- Style the mobile hamburger button --- */
    .menu-toggle {
        display: block;
        font-size: 26px;
        color: #333;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 10001; /* Extremely high to be on top of everything */
    }

    /* --- THIS IS THE KEY FIX --- */
    /* Styles for the mobile menu itself (hidden by default off-screen) */
    .main-nav {
        /* 1. Use position:fixed to lift it above ALL other content */
        position: fixed; 
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh; /* Full screen height */
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(5px);
        
        /* 2. Hide it by pushing it off-screen to the left */
        transform: translateX(-100%); 
        transition: transform 0.3s ease-in-out; /* Smooth slide animation */
        
        /* 3. Make it a flex container to center the links */
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 10000;
    }

    /* --- Styles for the VISIBLE Mobile Menu --- */
    .main-nav.is-active {
        /* When active, slide it into view */
        transform: translateX(0); 
    }
    
    /* Re-style the UL for the new full-screen menu */
    .main-nav.is-active ul {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    .main-nav.is-active a {
        font-size: 1.5rem; /* Larger font for mobile menu */
    }
}

/* ===================================
   CTA LOGIN BUTTON STYLES
   =================================== */

/* --- Base button styling for both buttons --- */
.nav-cta {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px; /* Softer, rounded corners */
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border: 2px solid transparent;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    transition: all 0.2s ease-in-out; /* Smooth hover effect */
}

/* --- Primary Button: Client Login --- */
.nav-cta.client-login {
    background-color: #007bff; /* A strong, professional blue */
    color: #ffffff;
}

/* --- Secondary Button: Student Login --- */
.nav-cta.student-login {
    background-color: #f8f9fa; /* A light, clean gray */
    color: #333333;
    border-color: #dee2e6; /* A subtle border */
}

/* --- Hover Effects --- */
/* Makes the button slightly lift and brighten on hover */
.nav-cta:hover {
    transform: translateY(-2px); /* Lifts the button slightly */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); /* Increases the shadow */
}

.nav-cta.client-login:hover {
    background-color: #0069d9; /* A slightly darker blue on hover */
}

.nav-cta.student-login:hover {
    background-color: #e9ecef; /* A slightly darker gray on hover */
    border-color: #ced4da;
}

/* --- 4. PAGE-SPECIFIC SECTIONS --- */

/* Hero Section (Homepage) */
.hero {
    background: linear-gradient(rgba(44, 62, 80, 0.7), rgba(44, 62, 80, 0.7)), url('https://images.unsplash.com/photo-1581091226825-a6a2a5aee158?q=80&w=2070&auto=format&fit=crop') no-repeat center center/cover;
    color: var(--white-color);
    padding: 6rem 0;
    text-align: center;
}
.hero h1 {
    font-size: 3.5rem;
    color: var(--white-color);
}
.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem auto;
}

/* General Section Styling */
.section {
    padding: 4rem 0;
}
.section-light {
    background-color: #f9fafb;
}
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}
.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Software Logos Section */
.software-logos {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.4s ease;
}
.software-logos:hover {
    filter: grayscale(0%);
    opacity: 1;
}
.software-logos img {
    height: 50px;
}

/* --- 5. COMPONENT STYLES --- */

/* Portfolio Page */
.portfolio-filters {
    text-align: center;
    margin-bottom: 2rem;
}
.filter-btn {
    background: var(--light-color);
    border: none;
    padding: 0.5rem 1.5rem;
    margin: 0 0.5rem;
    cursor: pointer;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
}
.filter-btn.active, .filter-btn:hover {
    background: var(--primary-color);
    color: var(--white-color);
}
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.tags {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tag {
    background-color: var(--light-color);
    color: var(--primary-color);
    padding: 0.2rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Courses Page */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
}
.course-card {
    background: var(--white-color);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}
/* Fix to make course-card links behave like blocks */
a.course-card {
    color: var(--text-color); /* Prevents text from turning blue */
    text-decoration: none;   /* Removes underline */
}
.course-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}
.course-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.course-category {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}
.course-card-body h3 {
    margin-top: 0;
    line-height: 1.2;
}
.course-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--light-color);
    border-bottom: 1px solid var(--light-color);
    font-size: 0.9rem;
    color: var(--text-color);
}
.course-details i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}
.course-card-body .btn {
    margin-top: auto;
    align-self: flex-start;
}

/* Forms (Contact, Login, Verify) */
.form-container {
    max-width: 600px;
    margin: auto;
    padding: 2rem;
    background: var(--white-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 10px;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Student Dashboard */
.dashboard-welcome {
    margin-bottom: 2rem;
}
.course-accordion .course-item {
    background: var(--white-color);
    margin-bottom: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.course-header {
    background: #f1f5f9;
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--dark-color);
}
.course-header i {
    transition: transform 0.3s ease;
}
.course-header.active i {
    transform: rotate(180deg);
}
.course-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.5s ease;
    padding: 0 1.5rem;
}
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin-bottom: 1rem;
    border-radius: 8px;
}
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- 6. FLOATING ACTION BUTTON (FAB) --- */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
}
.fab-button {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: var(--white-color);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.fab-button:hover {
    transform: scale(1.1);
    background-color: var(--secondary-color);
}
.fab-menu {
    position: absolute;
    bottom: 75px;
    right: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}
.fab-container.active .fab-menu {
    transform: scale(1);
}
.fab-menu li {
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.fab-menu a {
    color: var(--white-color);
    background-color: var(--dark-color);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.fab-container.active .fab-menu a {
    opacity: 1;
}

/* --- 7. FOOTER --- */
.main-footer {
    background: var(--dark-color);
    color: var(--light-color);
    padding: 3rem 0;
    text-align: center;
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: left;
    margin-bottom: 2rem;
}
.footer-content h4 {
    color: var(--white-color);
    margin-bottom: 1rem;
}
.footer-content ul {
    list-style: none;
}
.footer-content a {
    color: var(--light-color);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}
.footer-content a:hover {
    opacity: 1;
}
.social-links a {
    font-size: 1.5rem;
    margin-right: 1rem;
}
.footer-bottom {
    border-top: 1px solid #4a627a;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* --- 8. RESPONSIVE DESIGN --- */
@media(max-width: 768px) {
    /* Mobile Navigation */
    .menu-toggle {
        display: block;
    }
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white-color);
        flex-direction: column;
        align-items: center;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease-in-out;
    }
    .main-nav.active {
        max-height: 500px; /* Adjust as needed */
        padding: 1rem 0;
    }
    .main-nav ul {
        flex-direction: column;
        width: 100%;
        text-align: center;
    }
    .main-nav li {
        width: 100%;
    }
    .main-nav a {
        display: block;
        padding: 1rem;
    }
    
    /* General Layout */
    .hero h1 {
        font-size: 2.5rem;
    }
    .grid-3 {
        grid-template-columns: 1fr;
    }
    .course-grid {
        grid-template-columns: 1fr;
    }
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1px 2px;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo img {
    height: 45px; /* Default logo height */
    width: auto;
    vertical-align: middle;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 15px;
}

.menu-toggle {
    display: none; /* Hide hamburger icon by default */
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
}

/* --- Tablet and Mobile Styles (everything below 992px) --- */
@media (max-width: 992px) {
    .main-nav, .header-buttons {
        display: none; /* Hide the nav and buttons */
    }

    .menu-toggle {
        display: block; /* Show the hamburger icon */
    }
    
    .logo img {
        height: 35px; /* Make logo smaller on smaller screens */
    }
}

/* --- Mobile Only Styles (everything below 576px) --- */
@media (max-width: 576px) {
    .header-right {
        gap: 10px; /* Reduce gap on very small screens */
    }
}

/* Add this class with JavaScript to show the mobile menu when clicked */
.main-nav.is-active {
    display: flex;
    position: absolute;
    top: 70px; /* Position below the header */
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    flex-direction: column;
    padding: 10px;
    z-index: 1000;
}
.main-nav.is-active ul {
    flex-direction: column;
    width: 100%;
    text-align: center;
}