/* --- COMPACT & RICH TECH THEME --- */
:root {
    --bg-dark: #0f1115; 
    --bg-card: rgba(30, 33, 40, 0.7); 
    --text-main: #f8fafc;
    --text-muted: #b5c2d4;
    --accent-primary: #38bdf8; 
    --border-color: rgba(20, 151, 216, 0.75);
}

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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.5;
    color: var(--text-main);
    background-color: var(--bg-dark);    
    background-attachment: fixed;
    background-image: 
        linear-gradient(rgba(56,189,248,0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56,189,248,0.1) 1px, transparent 1px),
        radial-gradient(circle at 20% 30%, rgba(56,189,248,0.15), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(129,140,248,0.1), transparent 40%);
    background-size: 40px 40px, 40px 40px, auto, auto;
    
    padding: 1.5rem; /* Reduced padding */
    max-width: 1100px;
    margin: auto;
}

/* --- HERO SECTION --- */
.hero {
    text-align: center;
    margin-bottom: 2.5rem; /* Reduced from 4rem */
    padding: 2.5rem 1.5rem; /* Reduced height */
    background: var(--bg-card);
    border-radius: 16px; 
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero h1 {
    font-size: 3rem; /* Slightly smaller to save space */
    margin-bottom: 0.2rem;
    background: linear-gradient(to right, #fff, var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}

.hero h2 {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.profile-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.profile-pic {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-primary);
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.5);
    animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px rgba(56,189,248,0.4); }
    50% { box-shadow: 0 0 30px rgba(56,189,248,0.8); }
    100% { box-shadow: 0 0 10px rgba(56,189,248,0.4); }
}

.profile-pic:hover {
    transform: scale(1.05);
}

.tagline {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

/* Flexbox to put contact info in a tighter row */
.contact-info { 
    margin-bottom: 1.2rem; 
    font-size: 0.95rem; 
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}
.contact-info a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.contact-info a:hover { color: var(--accent-primary); }
.contact-info span { color: var(--border-color); }

.social-links a {
    display: inline-block;
    margin: 0 8px;
    padding: 10px 22px;
    color: white;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 20px rgba(56,189,248,0.5);
}

/* --- SECTIONS & TYPOGRAPHY --- */
section { margin-bottom: 2.5rem; } /* Reduced from 4rem to fix scrolling issue */

h3 {
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 15px;
}
h3::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--border-color), transparent);
}

h4 { color: var(--text-main); margin-bottom: 0.8rem; font-size: 1.05rem; }
.subtitle { color: var(--accent-primary); font-weight: 500; margin-bottom: 0.5rem; font-size: 1rem;}

/* --- NEW: SKILLS GRID --- */
/* This prevents skills from stacking vertically and forces them side-by-side */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.skill-group { display: flex; flex-wrap: wrap; gap: 8px; }

.skill-box {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}
.skill-box:hover {
    background: var(--accent-primary);
    color: var(--bg-dark);
    border-color: var(--accent-primary);
}

/* --- CARDS & PROJECT GRID --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem; 
    align-items: flex-start; 
}
/* .card-grid {
    column-count: 2;
    column-gap: 1.2rem;
} */

.card {
    background: var(--bg-card);
    padding: 1.5rem; 
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    
    /* Flexbox setup to make cards stretch and align inner content */
    display: flex;
    flex-direction: column;
    width: 100%;
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; gap: 10px; flex-wrap: wrap;}
.card-header h4 { margin: 0; font-size: 1.1rem; }

/* --- BADGES & LISTS --- */
.badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-primary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(56, 189, 248, 0.2);
}
.badge.highlight { background: rgba(56, 189, 248, 0.1); }

.bullet-list { margin-left: 1.2rem; color: var(--text-muted); font-size: 0.95rem; }
.bullet-list li { margin-bottom: 0.4rem; }
.bullet-list strong { color: var(--text-main); font-weight: 500;}
.content p { color: var(--text-muted); margin-bottom: 0.8rem; font-size: 0.95rem;}
.coursework { color: var(--text-muted); font-size: 0.85rem; margin-top: 1rem; border-top: 1px solid var(--border-color); padding-top: 0.8rem;}

/* --- BUTTONS --- */
.card-actions { margin-top: auto; padding-top: 1.5rem; display: flex; gap: 10px;}
.link-btn.outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}
.link-btn.outline:hover {
    background: var(--text-main);
    color: var(--bg-dark);
}

/* --- CERTIFICATIONS GRID --- */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem; /* Space between the blocks */
    list-style: none;
    padding: 0;
    margin: 0;
}

.cert-card {
    background-color: #1e1e24; 
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cert-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); 
}

.cert-card strong {
    font-size: 1rem;
    color: #ffffff; 
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.cert-issuer {
    font-size: 0.85em;
    font-style: italic;
    color: #a0a0a0;
    margin-bottom: 1rem;
}

.cert-link {
    font-size: 0.9em;
    color: #66b3ff; 
    text-decoration: none;
    font-weight: 500;
    align-self: flex-start;
}

.cert-link:hover {
    text-decoration: underline;
}

.project-images {
    display: flex;
    margin-top: 10px;
}

.project-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.project-images img:hover {
    transform: scale(1.08);
    border-color: var(--accent-primary);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 800px) {
    .cert-grid {
        grid-template-columns: 1fr; /* Changes back to 1 column on small screens */
    }
}

 /*The class without active */
.project-details {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

/* find class with both .project-card class and .active class, later find subclass .project-details */
.project-card.active .project-details {
    max-height: 500px;
    opacity: 1;
    margin-top: 10px;
}

.expand-icon {
    margin-left: auto;
    font-size: 1.5rem;
    color: var(--accent-primary);
    cursor: pointer;
    transition: transform 0.3s;
}

.project-card.active .expand-icon {
    transform: rotate(45deg);
}

.project-card.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(56,189,248,0.2);
}

.project-card {
    cursor: pointer;
    break-inside: avoid;
}

.project-card:hover {
    transform: scale(1.02);
}

@media (max-width: 800px) {
    .card-grid {
        grid-template-columns: 1fr; /* Forces 1 column on smaller screens */
    }
}

/* --- PROJECT IMAGE SLIDER --- */
.image-slider {
    width: 100%;
    overflow: hidden; /* Hides the second image until it slides in */
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-top: 10px;
    margin-bottom: 10px;
    transition: border-color 0.3s ease;
}

.image-slider:hover {
    border-color: var(--accent-primary);
}

.slider-track {
    display: flex;
    width: 200%; /* 2 images = 200% width */
    /* 8s total cycle: slides back and forth smoothly */
    animation: slideImages 6s infinite ease-in-out; 
}

/* Pause the sliding animation when the user hovers over the images */
.image-slider:hover .slider-track {
    animation-play-state: paused; 
}

.slider-track img {
    width: 50%; /* Each image takes exactly half of the 200% track (100% of the visible container) */
    flex-shrink: 0;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.slider-track img:hover {
    transform: scale(1.08); /* Slight zoom on hover, contained within the slider */
}

/* Keyframes for sliding 2 images */
@keyframes slideImages {
    0%, 40% { 
        transform: translateX(0); /* Stay on Image 1 */
    }
    50%, 90% { 
        transform: translateX(-50%); /* Slide to Image 2 */
    }
    100% { 
        transform: translateX(0); /* Slide back to Image 1 */
    }
}

.teaching {
    width: 160px; /* Made the block bigger */
    height: 160px; 
    background: #ffffff; /* Solid white background */
    border-radius: 50%; /* Makes the white background a perfect circle */
    display: flex;
    align-items: center;
    justify-content: center; 
    border: 3px solid rgba(56, 189, 248, 0.8); /* Slightly thicker border to pop */
    box-shadow: 0 5px 25px rgba(56, 189, 248, 0.3); /* Stronger glow effect */
    flex-shrink: 0; /* Prevents the image from squishing on smaller screens */
    padding: 20px; /* Gives the logo some breathing room inside the white circle */
    transition: transform 0.3s ease;
}

.teaching:hover {
    transform: scale(1.05); /* Adds a subtle zoom effect when hovering over the logo */
}

/* Layout for the Teaching Section */
.teaching-container {
    display: flex;
    flex-direction: column-reverse; /* Image on top for mobile */
    align-items: center;
    gap: 2rem;
    text-align: center; /* Center text on mobile */
}

.teaching-text {
    flex: 1;
}

.teaching-text .description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.teaching-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center; /* Center buttons on mobile */
}

/* Desktop View (Screens wider than 800px) */
@media (min-width: 800px) {
    .teaching-container {
        flex-direction: row; /* Side-by-side */
        text-align: left;    /* Left align text */
        align-items: center;
    }

    .teaching-btns {
        justify-content: flex-start; /* Align buttons to left */
    }
    
    /* Ensure the text takes up the remaining space */
    .teaching-text {
        min-width: 300px;
    }
}