/* 1. GLOBAL STYLES & VARIABLES
---------------------------------------------------- */
:root {
    --primary-color: #005A9C; /* A professional, deep blue */
    --primary-hover: #004070; /* Darker blue for hover */
    --accent-color: #007BFF; /* A brighter blue for accents and links */
    --text-color: #333333;
    --light-text-color: #f8f9fa;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --border-color: #dee2e6;
    --shadow: 0px 4px 15px rgba(0, 0, 0, 0.25);
    --shadow-light: 0px 4px 15px rgba(0, 0, 0, 0.07);

}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 16px;
    line-height: 1.7;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    padding: 20px 0;
}

h1, h2, h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 600;
}

h1 { font-size: 2.8em; }
h2 { font-size: 2.2em; }
h3 { font-size: 1.5em; }

p {
    margin-bottom: 15px;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* 2. HEADER & NAVIGATION
---------------------------------------------------- */
header {
    background: var(--card-background);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--primary-color);
}

header nav ul {
    display: flex;
    list-style: none;
}

header nav ul li {
    margin-left: 25px;
}

header nav a {
    font-weight: 600;
    font-size: 1.1em;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s ease, color 0.3s ease;
}

header nav a:hover, header nav a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    text-decoration: none;
}

#menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    width: 30px;
    height: 22px;
    z-index: 10;
}

.bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: all 0.35s ease-in-out;
    position: absolute;
}

.bar:nth-child(1) {
    top: 0;
}

.bar:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.bar:nth-child(3) {
    bottom: 0;
}

#menu-toggle.active .bar:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

#menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

#menu-toggle.active .bar:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}


/* 3. HOME PAGE SPECIFIC STYLES
---------------------------------------------------- */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    background: var(--card-background);
    gap: 60px;
}

.hero-text {
    max-width: 550px;
}

.hero-text .subtitle {
    font-size: 1.5em;
    color: #555;
    margin-bottom: 20px;
    font-weight: 300;
}

.hero-image img {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    object-fit: cover;
    border: 8px solid var(--primary-color);
    box-shadow: var(--shadow);
}

.btn {
    display: inline-block;
    background: var(--accent-color);
    color: var(--light-text-color);
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 0.96em;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center; /* Ensures text is centered */
    flex: 1; /* Key property: makes buttons grow to equal widths */
}

.btn:hover {
    background: var(--primary-hover);
    color: var(--light-text-color);
    transform: translateY(-3px);
    text-decoration: none;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    
}

.stats {
    background: var(--background-color);
    padding: 60px 0;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.stat-item {
    background: var(--card-background);
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-item h3 {
    font-size: 3em;
    margin: 0 0 5px 0;
    color: var(--accent-color);
}

.stat-item p {
    font-size: 1.1em;
    margin: 0;
    color: #555;
    font-weight: 600;
}

/* 4. GENERIC INNER PAGE STYLES
---------------------------------------------------- */
.page-header {
    background: var(--primary-color);
    color: var(--light-text-color);
    padding: 50px 0;
    text-align: center;
}

.page-header h1 {
    color: var(--light-text-color);
    font-size: 3em;
    margin: 0;
}

/* main {
    padding: 60px 0;
} */

blockquote {
    background: #e9ecef;
    border-left: 5px solid var(--accent-color);
    margin: 30px 0;
    padding: 20px 30px;
    font-style: italic;
    font-size: 1.1em;
    border-radius: 0 8px 8px 0;
}

blockquote cite {
    display: block;
    margin-top: 15px;
    font-weight: 600;
    color: #555;
    font-style: normal;
}

.list-section {
    background: var(--card-background);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}
.list-section h3 {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
    margin-top: 0;
}
.list-section ul {
    list-style-type: none;
    padding-left: 0;
}
.list-section ul li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.list-section ul li:last-child {
    border-bottom: none;
}
.list-section ul li::before {
    content: "■";
    color: var(--accent-color);
    margin-right: 12px;
    font-size: 0.8em;
}


/* 5. TABLES & CONTACT PAGE
---------------------------------------------------- */
.course-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.course-table th, .course-table td {
    padding: 15px;
    border: 1px solid var(--border-color);
    text-align: left;
    white-space: nowrap; /* Prevents text from wrapping */
}
.course-table thead {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    font-size: 1.1em;
}
.course-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}
.course-table tbody tr:hover {
    background-color: #e9ecef;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: flex-start;
}

.contact-info-item {
    background: var(--card-background);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.contact-info-item h3 {
    margin-top: 0;
    font-size: 1.3em;
}
.contact-info-item p {
    margin-bottom: 5px;
}

/* 6. FOOTER
---------------------------------------------------- */
footer {
    background: #212529;
    color: var(--light-text-color);
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
}
footer p {
    margin: 0;
    opacity: 0.8;
}

/* 7. RESPONSIVE MEDIA QUERIES
---------------------------------------------------- */
@media (max-width: 992px) {
    h1 { font-size: 2.5em; }
    h2 { font-size: 2em; }
    .hero {
        flex-direction: column-reverse; /* Puts image on top on tablets */
        text-align: center;
    }
    .hero-text {
        max-width: 100%;
    }
    .btn {
        margin-right: 10px;
        margin-bottom: -5px;
    }
    .contact-grid {
        grid-template-columns: 1fr; /* Stacks contact sections */
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    #menu-toggle {
        display: block; /* Show hamburger icon */
    }
    header nav ul {
        position: absolute;
        top: 100%; /* Positions the menu right below the header, making it dynamic */
        left: 0;
        right: 0;
        background: var(--card-background);
        flex-direction: column;
        width: 100%;
        box-shadow: 0 10px 10px rgba(0,0,0,0.1);
        /* border-top is removed to avoid a double border with the header's bottom border */
        /* ANIMATION STYLES */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
    }
    header nav ul.active {
        max-height: 500px; /* Large enough to show all links */
    }
    header nav ul li {
        margin: 0;
        text-align: center;
    }
    header nav a {
        display: block;
        padding: 15px;
        border-bottom: 1px solid var(--border-color);
    }
    header nav a:hover, header nav a.active {
        background: var(--background-color);
        border-bottom-color: var(--border-color);
    }

    .hero-image img {
        width: 250px;
        height: 250px;
    }

    /* --- NEW ---: Styles to reduce page header size on mobile */
    .page-header {
        padding: 30px 0;
    }
    .page-header h1 {
        font-size: 2.2em;
    }

    .button-group {
        flex-direction: column;
        width: 73%; /* Makes the container narrower than the screen */
        max-width: 400px; /* Prevents buttons from being too wide on tablets */
        margin-left: auto;  /* Centers the container */
        margin-right: auto; /* Centers the container */
        
    }
    /* --- END NEW --- */
}

/* 8. RESPONSIVE TABLE TRANSFORMATION (CARD LAYOUT)
---------------------------------------------------- */
@media screen and (max-width: 768px) {
    /* This section does not apply to tables converted to accordions */
    table:not(.convert-to-accordion) {
        border: none;
        box-shadow: none;
    }

    .table-container {
        overflow-x: visible;
        box-shadow: none;
    }
    
    table:not(.convert-to-accordion) thead {
        border: none;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }

    table:not(.convert-to-accordion) tr {
        display: block;
        margin-bottom: 20px;
        border-radius: 12px;
        background: var(--card-background);
        border: 1px solid var(--border-color);
    }

    table:not(.convert-to-accordion) td {
        border: none;
        border-bottom: 1px solid var(--border-color); 
        display: block;
        text-align: right;
        padding: 12px 15px;
        white-space: normal;
    }

    table:not(.convert-to-accordion) td:last-child {
        border-bottom: none;
    }

    table:not(.convert-to-accordion) td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        color: var(--primary-color);
        text-transform: uppercase;
        font-size: 0.9em;
    }
}

/* 9. ACCORDION STYLES (Mobile Only)
---------------------------------------------------- */
.accordion-group {
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--card-background);
}

.accordion-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--primary-color);
}

.accordion-header .accordion-arrow {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--accent-color);
    border-right: 2px solid var(--accent-color);
    transition: transform 0.4s ease-in-out;
    transform: rotate(135deg);
}

.accordion-header.active .accordion-arrow {
    transform: rotate(-45deg);
}

.accordion-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease-in-out;
}

.accordion-panel.active {
    grid-template-rows: 1fr;
}

.accordion-panel-content {
    min-height: 0;
    overflow: hidden;
    padding: 0 20px;
    border-top: 1px solid var(--border-color);
}

.accordion-content-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.accordion-content-item:last-child {
    border-bottom: none;
    padding-bottom: 15px;
}
.accordion-content-item:first-child {
    padding-top: 15px;
}
.accordion-content-item div {
    padding: 2px 0;
}

@media screen and (max-width: 768px) {
    table.convert-to-accordion {
        display: none;
    }
}

/* 10. TIMELINE TABLE MOBILE STYLES
---------------------------------------------------- */
@media screen and (max-width: 768px) {
    table.timeline-table tr {
        display: flex;
        flex-direction: column;
        padding: 15px;
    }

    table.timeline-table td {
        display: block;
        border: none;
        padding: 0;
        text-align: left;
        line-height: 1.6;
    }
    
    table.timeline-table td::before {
        content: none;
    }

    table.timeline-table td[data-label="Year"] {
        font-weight: 700;
        color: var(--primary-color);
        font-size: 1.1em;
        line-height: 1.3;
    }
}

/* 11. CUSTOM PARTITION LINES (Mobile Only)
---------------------------------------------------- */
@media screen and (max-width: 768px) {
    /* Partition line for the Career Timeline card */
    table.timeline-table td[data-label="Year"] {
        padding-bottom: 10px;
        margin-bottom: 10px;
        border-bottom: 1px solid var(--border-color);
    }
}

/* 12. BACK TO TOP BUTTON
---------------------------------------------------- */
#back-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--light-text-color);
    text-align: center;
    font-size: 24px;
    line-height: 50px;
    border-radius: 50%;
    z-index: 999;
    cursor: pointer;
    box-shadow: var(--shadow);
    text-decoration: none;
    
    /* Initially hidden */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}

#back-to-top-btn:hover {
    background-color: var(--primary-hover);
    color: var(--light-text-color);
    text-decoration: none;
}

#back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mobile optimization for the button */
@media (max-width: 768px) {
    #back-to-top-btn {
        width: 45px;
        height: 45px;
        line-height: 45px;
        font-size: 20px;
        right: 15px;
        bottom: 15px;
    }
}

/* 13. WHATSAPP FLOATING BUTTON (MOBILE ONLY)
---------------------------------------------------- */
#whatsapp-fab {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background-color: #25D366; /* Official WhatsApp Green */
    border-radius: 50%;
    box-shadow: var(--shadow);
    z-index: 999;
    
    /* For centering the icon */
    display: flex;
    align-items: center;
    justify-content: center;
    
    transition: transform 0.2s ease, background-color 0.2s ease;
}

#whatsapp-fab:hover {
    background-color: #1DA851; /* Darker green on hover */
    transform: scale(1.1);
}

/* NEW: Style for the image inside the button */
#whatsapp-fab img {
    width: 75px;
    height: 75px;
}

/* Show and adjust for mobile */
@media (max-width: 768px) {
    #whatsapp-fab {
        display: flex; /* Make it visible on mobile */
        width: 45px;
        height: 45px;
        bottom: 15px;
        left: 15px;
    }
    
    /* NEW: Adjust image size for mobile */
    #whatsapp-fab img {
        width: 75px;
        height: 75px;
    }
}