/* ========================
   Global Styles
   ======================== */

:root {
    /* Light Mode Colors */
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --light-bg: #ecf0f1;
    --dark-text: #34495e;
    --light-text: #7f8c8d;
    --white: #ffffff;
    --border-color: #bdc3c7;
}

/* Dark Mode Colors */
html[data-theme="dark"] {
    --primary-color: #1a1a2e;
    --secondary-color: #0f3460;
    --accent-color: #e94560;
    --light-bg: #16213e;
    --dark-text: #eaeaea;
    --light-text: #b0b0b0;
    --white: #0f0f0f;
    --border-color: #444444;
}

html[data-theme="dark"] {
    background-color: #0f0f0f;
    color: #eaeaea;
}

/* Ensure all text elements inherit proper colors in dark mode */
html[data-theme="dark"] * {
    color: inherit;
}

html[data-theme="dark"] p,
html[data-theme="dark"] span,
html[data-theme="dark"] div,
html[data-theme="dark"] li,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
    color: var(--dark-text);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: var(--white);
}

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

/* ========================
   Header & Navigation
   ======================== */

.header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.navbar {
    padding: 1rem 0;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--secondary-color);
}

/* Dark mode navigation link colors */
html[data-theme="dark"] .nav-links a {
    color: var(--dark-text);
}

html[data-theme="dark"] .nav-links a:hover {
    color: var(--accent-color);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 2px solid var(--secondary-color);
    color: var(--white);
    cursor: pointer;
    padding: 0.5rem 0.8rem;
    border-radius: 50%;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: 1rem;
}

.theme-toggle:hover {
    background-color: var(--secondary-color);
    transform: scale(1.1);
}

.theme-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.theme-toggle:active .theme-icon {
    transform: rotate(20deg);
}

/* ========================
   Hero Section
   ======================== */

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 6rem 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.tagline {
    font-size: 1.5rem;
    color: var(--light-bg);
    margin-bottom: 1.5rem;
}

.subtitle {
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

/* ========================
   Sections
   ======================== */

section {
    padding: 4rem 0;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary-color);
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

/* ========================
   About Section
   ======================== */

.about {
    background-color: var(--light-bg);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: var(--dark-text);
    text-align: justify;
}

/* ========================
   Education Section
   ======================== */

.education {
    background-color: var(--white);
}

.education-item {
    background-color: var(--light-bg);
    padding: 2rem;
    border-left: 4px solid var(--secondary-color);
    margin-bottom: 2rem;
    border-radius: 4px;
}

.education-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.degree {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.period {
    color: var(--light-text);
    font-style: italic;
    font-size: 0.95rem;
}

/* ========================
   Courses Section
   ======================== */

.courses {
    background-color: var(--light-bg);
}

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

.courses li {
    background-color: var(--white);
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    border-left: 5px solid transparent;
    box-shadow: 0 0 0 rgba(0,0,0,0);
    border-left-color: var(--secondary-color);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.courses li:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    border-left-color: var(--secondary-color);
    background-color: var(--white);
}

.course-title {
    font-weight: 600;
    color: var(--primary-color);
}

.course-details {
    display: grid;
    grid-template-rows: 0fr;          
    transition: grid-template-rows 0.4s ease-in-out;
    background-color: transparent;
    margin-top: 0.5rem;
    border-radius: 4px;
    color: var(--dark-text);
    line-height: 1.6;
}

.course-details > * {
    overflow: hidden;                 
}

.course-details.expanded {
    grid-template-rows: 1fr;       
    margin-top: 0.9rem;
    margin-bottom: 0.9rem;
}

.course-details-inner ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin: 0;
}

.course-details-inner li {
    margin-bottom: 0.5rem;
    color: var(--dark-text);
}

/* ========================
   Experience Section
   ======================== */

.experience {
    background-color: var(--light-bg);
}

.experience-item {
    background-color: var(--white);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--secondary-color);
}

.experience-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.role {
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.experience-details,
.certifications {
    margin-top: 1rem;
    padding-left: 2rem;
}

.certifications li ul {
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.certifications li ul li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.experience-details li,
.certifications li {
    margin-bottom: 0.8rem;
    color: var(--dark-text);
    line-height: 1.6;
}

/* ========================
   Skills Section
   ======================== */

.skills {
    background-color: var(--white);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-category {
    background-color: var(--light-bg);
    padding: 2rem;
    border-radius: 6px;
    border-top: 4px solid var(--secondary-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.skill-category h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    padding: 0.5rem 0;
    color: var(--dark-text);
    position: relative;
    padding-left: 1.5rem;
}

.skill-category li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

/* ========================
   Projects Section
   ======================== */

.projects {
    background-color: var(--light-bg);
}

.project-card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--secondary-color);
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.project-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.project-card h4 {
    color: var(--secondary-color);
    margin-top: 1rem;
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.project-description {
    color: var(--dark-text);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-card ul {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.project-card li {
    color: var(--dark-text);
    margin-bottom: 0.6rem;
    line-height: 1.6;
}

.tech-stack {
    color: var(--light-text);
    font-size: 0.95rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-style: italic;
}

/* ========================
   Contact Section
   ======================== */

.contact {
    background-color: var(--white);
}

.contact-info {
    background-color: var(--light-bg);
    padding: 3rem;
    border-radius: 8px;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-item {
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.label {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 1rem;
}

.contact-item a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: var(--accent-color);
}

/* ========================
   Footer
   ======================== */

.footer {
    background-color: var(--primary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer p {
    margin: 0;
}

/* ========================
   Responsive Design
   ======================== */

@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .theme-toggle {
        margin-left: 0;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1.2rem;
    }

    section h2 {
        font-size: 2rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .experience-item,
    .project-card {
        padding: 1.5rem;
    }

    .contact-info {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 1rem;
    }

    section {
        padding: 2rem 0;
    }

    section h2 {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .nav-links {
        gap: 0.5rem;
    }

    .nav-links a {
        font-size: 0.9rem;
    }
}
