/*
 * =================================================================
 * GLOBAL COLOR VARIABLES & DARK MODE (BRIGHTER LIGHT MODE)
 * =================================================================
 */
:root {
    /* BRIGHTER LIGHT MODE DEFAULTS */
    --primary-color: #007bff;        /* Vibrant Blue accent */
    --secondary-color: #34495e;      /* Dark Header/Footer (for contrast) */
    --background-color: #ffffff;     /* Pure White Body Background */
    --card-background: #ffffff;      /* Pure White Card Background */
    --text-color: #212529;           /* Deep Black Text */
    --overlay-bg: rgba(0, 0, 0, 0.6); /* Overlay background */
    --transition-speed: 0.3s;
}

/* DARK MODE OVERRIDES */
.dark-mode {
    --primary-color: #85c1e9;        
    --secondary-color: #1c2630;      
    --background-color: #242424;     
    --card-background: #333333;      
    --text-color: #f4f7f6;           
    --overlay-bg: rgba(255, 255, 255, 0.2); 
}

/*
 * =================================================================
 * BASE STYLING & STICKY FOOTER SETUP
 * =================================================================
 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Flexbox setup to make the footer sticky */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color var(--transition-speed) ease;
    
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Fills the viewport height */
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease, opacity var(--transition-speed) ease;
}

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

/*
 * =================================================================
 * HEADER & NAVIGATION
 * =================================================================
 */
.main-header {
    background: var(--secondary-color);
    color: #fff;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between; /* Separates title and nav block */
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0; 
}

.site-title a {
    color: #fff;
    font-size: 1.5rem;
    transition: color var(--transition-speed) ease;
}

.main-nav {
    display: flex; 
    align-items: center;
    margin-left: auto; /* Pushes nav block to the right */
    justify-content: flex-end; /* Keeps items within nav block grouped to the right */
}

.main-nav a {
    color: rgba(255, 255, 255, 0.7);
    margin-left: 1.5rem;
    padding: 0.5rem 0.5rem 0.5rem 0; /* Adjusted padding for better flow with toggle */
    position: relative;
    transition: all var(--transition-speed) ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: #fff;
}

.main-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform var(--transition-speed) ease-out;
}
.main-nav a.active::after,
.main-nav a:hover::after {
    transform: scaleX(1);
}

/*
 * =================================================================
 * MAIN CONTENT & FOOTER
 * =================================================================
 */
.content-area {
    flex-grow: 1; /* Pushes footer to the bottom */
    padding: 2rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.site-footer {
    flex-shrink: 0; 
    text-align: center;
    padding: 1rem 0;
    background: var(--secondary-color);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/*
 * =================================================================
 * HOMEPAGE SECTIONS
 * =================================================================
 */
.hero-section {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--card-background);
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: background var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.8rem 2rem;
    margin-top: 1rem;
    border-radius: 5px;
    font-weight: bold;
    letter-spacing: 1px;
    transition: transform var(--transition-speed) ease, background var(--transition-speed) ease;
}

.youtube-feed-section {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-top: 1px solid rgba(136, 136, 136, 0.2);
    border-bottom: 1px solid rgba(136, 136, 136, 0.2);
}

.video-container {
    margin: 0 auto; 
    max-width: 800px;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.recent-posts-section {
    padding-top: 2rem;
    border-top: 1px solid rgba(136, 136, 136, 0.2);
    margin-top: 2rem;
    text-align: center;
}

.recent-posts-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.view-all-link {
    margin-top: 2rem;
    padding-bottom: 2rem;
    font-size: 1.1rem;
    font-weight: bold;
}


/*
 * =================================================================
 * POSTS LISTING & CARDS
 * =================================================================
 */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.post-card {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    cursor: pointer;
}

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

.post-date {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.5rem;
}

.read-more-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition-speed) ease;
}


/*
 * =================================================================
 * ABOUT PAGE & SOCIAL ICONS
 * =================================================================
 */
.about-me {
    text-align: center;
    padding: 2rem;
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 4px solid var(--primary-color);
}

.social-links {
    text-align: center; 
    margin-top: 2rem;
}

.social-icons {
    text-align: center; 
    margin-top: 1rem;
}

.social-icon {
    display: inline-flex; 
    justify-content: center; 
    align-items: center; 
    
    width: 40px;
    height: 40px;
    margin: 0 0.5rem;
    border-radius: 50%; 
    background: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    
    transition: all 0.3s ease;
}

.social-icon i {
    font-size: 1.5rem; 
    color: white; 
    line-height: 1;
    transition: transform 0.3s ease;
}

.social-icon:hover {
    background: var(--secondary-color);
    transform: translateY(-3px); 
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.5); 
}

.social-icon:hover i {
    transform: scale(1.1);
}

/*
 * =================================================================
 * OVERLAY/MODAL STYLING
 * =================================================================
 */
.overlay {
    display: none; 
    position: fixed;
    z-index: 100; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: var(--overlay-bg); 
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.overlay.is-visible {
    display: block;
    opacity: 1;
}

.overlay-content {
    background-color: var(--card-background);
    color: var(--text-color);
    margin: 5% auto; 
    padding: 20px;
    border-radius: 8px;
    width: 80%; 
    max-width: 800px; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    
    transform: scale(0.95);
    opacity: 0;
    transition: transform var(--transition-speed) ease-out, opacity var(--transition-speed) ease-out;
}

.overlay.is-visible .overlay-content {
    transform: scale(1);
    opacity: 1;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color var(--transition-speed) ease;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--text-color);
}

.post-content-container {
    max-height: 80vh; 
    overflow-y: auto;
    padding-right: 10px; 
}


/*
 * =================================================================
 * DARK/LIGHT MODE TOGGLE SWITCH
 * =================================================================
 */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-left: 1.5rem; /* Space after the 'About' link */
    padding-right: 5px; /* Spacing from the edge of the header */
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px; 
    height: 28px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--primary-color); /* Off-state background color */
    transition: 0.4s;
    border-radius: 28px; 
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px; 
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(22px);
}


/*
 * =================================================================
 * RESPONSIVE DESIGN
 * =================================================================
 */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        text-align: center;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .main-nav {
        margin-top: 1rem;
        margin-left: 0;
        justify-content: center;
    }

    .main-nav a {
        margin: 0 0.5rem;
    }

    .theme-switch-wrapper {
        margin-left: 0.5rem;
        padding-right: 0;
    }

    .overlay-content {
        width: 95%;
        margin: 2% auto;
    }
}

/* --- Resume Specific Styles --- */

.resume-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.resume-header h2 {
    margin: 0;
}

.download-button {
    /* Uses the existing cta-button style but makes it slightly smaller */
    padding: 0.5rem 1rem; 
    font-size: 0.9rem;
    background-color: #2ecc71; /* Green color for Download button */
    
    /* Ensure the icon has space */
    display: inline-flex;
    align-items: center;
}

.download-button i {
    margin-right: 5px;
}

.resume-pdf-viewer {
    width: 100%;
    /* Set a height that makes sense within the scrollable modal */
    height: 70vh; 
    border: 1px solid var(--text-color);
    border-radius: 5px;
}

/* Ensure the main resume content container scrolls nicely */
.post-content-container {
    /* This rule already exists, but confirm it's working: */
    max-height: 80vh; 
    overflow-y: auto;
    padding-right: 10px; 
}

/* In style.css (usually in an "Animations" or "Effects" section) */

/* --- Bounce Animation (for buttons/icons) --- */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.animated-bounce:hover {
    animation: bounce 1s ease-in-out;
}