/* Base Styles & Design Tokens */
:root {
    /* Sophisticated Palette */
    --primary-indigo: #4f46e5;
    --primary-indigo-dark: #3730a3;
    --primary-slate: #0f172a;
    --primary-slate-light: #1e293b;
    
    /* Bright Accent for Importance */
    --accent-bright: #ff5722; 
    --accent-bright-hover: #e64a19;
    --accent-cyan: #06b6d4;
    
    /* Premium Neutrals */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-600: #475569;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Text */
    --text-color: #1e293b;
    --text-muted: #64748b;
    
    /* Semantic Aliases */
    --primary-color: var(--primary-indigo);
    --secondary-color: var(--primary-slate);
    --accent-color: var(--accent-bright);

    /* Spacing & Layout */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.75rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --section-padding: 100px;

    /* Modern Radii */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    /* Layered Shadows */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.2s var(--ease-out);
    --transition-normal: 0.3s var(--ease-out);
    --transition-slow: 0.5s var(--ease-out);

    /* Glassmorphism Defaults */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --nav-bg: rgba(255, 255, 255, 0.7);
}

:root[data-theme='dark'] {
    --bg-color: #020617;
    --card-bg: #0f172a;
    --nav-bg: rgba(2, 6, 23, 0.85);
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --secondary-color: #f8fafc; /* Brightened for headings in dark mode */
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-600: #94a3b8;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;
    --primary-indigo: #818cf8;
    --primary-indigo-dark: #a5b4fc;
    --glass-bg: rgba(15, 23, 42, 0.9);
    --glass-border: rgba(255, 255, 255, 0.15);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: 15px; /* Slightly smaller for a better fit */
    padding-top: 80px !important;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

.container {
    width: 92%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 28px;
}

section {
    padding: var(--section-padding) 0;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--secondary-color);
    position: relative;
    letter-spacing: -1px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #0077b5, #00a8ff);
    border-radius: 2px;
}

/* ===== FIXED NAVIGATION ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    padding: 1.2rem 0;
    transition: all var(--transition-normal);
    border-bottom: 1px solid var(--glass-border);
}

.navbar.scrolled {
    padding: 0.8rem 0;
    background: var(--glass-bg);
}

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

.nav-logo-container {
    background: linear-gradient(135deg, var(--primary-indigo), var(--accent-cyan));
    padding: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-logo-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top; /* Shift focus to face */
    border: 2px solid white;
}

.brand-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    letter-spacing: -0.5px;
    font-size: 1.6rem;
    color: var(--text-color);
}

.portal-link {
    background: linear-gradient(135deg, var(--accent-bright), #ff8a65);
    color: white !important;
    padding: 10px 24px !important;
    border-radius: 50px; /* Perfect pill shape */
    margin-left: 15px;
    font-weight: 700;
    transition: all 0.4s var(--ease-out);
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex; /* Fix for text stacking */
    align-items: center;
    gap: 10px;
    white-space: nowrap; /* Prevent wrapping */
    text-decoration: none;
}

.portal-link i {
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.portal-link:hover i {
    transform: translate(2px, -2px);
}

.portal-link:hover {
    background: linear-gradient(135deg, #ff8a65, var(--accent-bright));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 87, 34, 0.5);
}

:root[data-theme='dark'] .portal-link {
    box-shadow: 0 4px 20px rgba(255, 87, 34, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Navigation Menu */
.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.25rem; /* Reduced from 2rem to prevent overflow */
    align-items: center;
}

@media (max-width: 1200px) {
    .navbar-nav { gap: 1rem; }
    .navbar-nav .nav-link { padding: 0.5rem 0.6rem; font-size: 0.9rem; }
}

@media (max-width: 992px) {
    .navbar-nav { gap: 0.5rem; }
    .navbar-nav .nav-link { padding: 0.4rem 0.5rem; font-size: 0.85rem; }
}

.navbar-nav .nav-item {
    margin: 0;
}

.navbar-nav .nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-blue);
    background: rgba(0, 119, 181, 0.08);
}

.navbar-nav .nav-link.active {
    color: var(--primary-blue);
    font-weight: 700;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background: var(--primary-blue);
    border-radius: 1px;
}

/* Mobile Toggle Button */
.navbar-toggler {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.navbar-toggler:hover {
    background: rgba(0, 119, 181, 0.08);
}

.navbar-toggler-icon {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-color);
    position: relative;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-color);
    position: absolute;
    left: 0;
}

.navbar-toggler-icon::before {
    top: -7px;
}

.navbar-toggler-icon::after {
    top: 7px;
}

/* Mobile Menu */
@media (max-width: 768px) {
    .navbar-toggler {
        display: block;
    }

    .navbar-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1.5rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        border-radius: 0 0 12px 12px;
        gap: 1rem;
    }

    .navbar-nav.show {
        display: flex;
    }

    .navbar-nav .nav-link {
        padding: 1rem 1.5rem;
        width: 100%;
        text-align: center;
        border-radius: 8px;
    }

    .navbar-nav .nav-link.active::after {
        display: none;
    }

    .navbar-nav .nav-link.active {
        background: rgba(0, 119, 181, 0.12);
        color: var(--primary-blue);
    }
}

/* Theme Toggle Button */
.theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--gray-200);
    color: var(--text-color);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s var(--ease-out);
    margin-left: 0.5rem; /* Reduced margin */
    flex-shrink: 0; /* Ensure it never disappears */
    backdrop-filter: blur(5px);
}

.theme-toggle:hover {
    background: var(--primary-indigo);
    color: white;
    border-color: var(--primary-indigo);
    transform: rotate(360deg) scale(1.1);
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.4);
}

.theme-toggle i {
    font-size: 1.1rem;
    color: inherit; /* Ensure it takes button color */
}

:root[data-theme='dark'] .theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff; /* Forced white for visibility */
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 999;
}

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

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Smooth scrolling for the whole page */
html {
    scroll-behavior: smooth;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(79, 70, 229, 0); }
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Remove old header styles */
header {
    display: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 20px;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: #fff;
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh;
    padding: 140px 0 100px;
    background: radial-gradient(circle at top right, rgba(79, 70, 229, 0.1), transparent),
                radial-gradient(circle at bottom left, rgba(6, 182, 212, 0.1), transparent);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.hero-shapes .shape {
    position: absolute;
    filter: blur(80px);
    z-index: -1;
    border-radius: 50%;
    opacity: 0.4;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-indigo);
    top: -100px;
    right: -100px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-cyan);
    bottom: -50px;
    left: -50px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 80px;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-indigo);
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 24px;
    border: 1px solid rgba(79, 70, 229, 0.2);
    animation: scale-in 0.8s var(--ease-out);
}

.hero-content h1 {
    font-size: 5.5rem;
    line-height: 0.95;
    margin-bottom: 24px;
    font-weight: 900;
    letter-spacing: -3px;
}

.hero-title-serif {
    font-family: 'Playfair Display', serif;
    color: var(--text-color);
}

.hero-title-italic {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-bright) 0%, #ff8a65 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    padding-right: 10px;
    animation: pulse-glow 3s infinite;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 50px;
    position: relative;
    color: var(--secondary-color);
    letter-spacing: -1px;
}

:root[data-theme='dark'] .section-title {
    text-shadow: 0 0 20px rgba(129, 140, 248, 0.1);
}

.achievement-highlights {
    justify-content: flex-start;
    margin-bottom: 40px;
}

.achievement-highlights span {
    background: var(--card-bg);
    border: 1px solid var(--gray-200);
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

/* Hero Image Container */
.hero-image-container {
    position: relative;
}

.image-wrapper {
    position: relative;
    padding: 20px;
}

.image-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px dashed var(--primary-indigo);
    border-radius: var(--radius-xl);
    opacity: 0.3;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.floating-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center 10%; /* Center the face properly */
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    animation: float 6s ease-in-out infinite;
    border: 4px solid white;
}

.experience-badge {
    position: absolute;
    bottom: -10px;
    right: -10px;
    background: var(--accent-bright);
    color: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    animation: scale-in 1s var(--ease-out) 0.5s both;
}

.experience-badge .count {
    font-size: 2rem;
    font-weight: 900;
}

.experience-badge .text {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    text-align: center;
}

.btn-glow {
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.4);
}

.btn-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: translateX(-100%);
    transition: 0.5s;
}

.btn-glow:hover::after {
    transform: translateX(100%);
}

.btn-bright {
    background: var(--accent-bright);
    color: white;
}

.btn-bright:hover {
    background: var(--accent-bright-hover);
    box-shadow: 0 8px 25px rgba(255, 87, 34, 0.4);
}

/* ===== ABOUT SECTION ===== */
.about-section .about-text p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
    color: var(--text-muted);
    font-size: 1rem;
}

.about-section .about-text p:last-child {
    margin-bottom: 0;
}

/* ===== TEACHING SECTION ===== */
.teaching-section {
    background: var(--bg-color);
    transition: background var(--transition-normal);
}

.teaching-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    margin-top: 50px;
}

.teaching-card {
    background: var(--card-bg);
    padding: 36px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-blue);
    border: 1px solid var(--gray-100);
    border-left: 4px solid var(--primary-blue);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.teaching-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 119, 181, 0.1), transparent);
    transition: left 0.6s;
    z-index: 0;
}

.teaching-card:hover::before {
    left: 100%;
}

.teaching-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.teaching-card h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.teaching-card p {
    color: #555;
    line-height: 1.7;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.skill-tag {
    background: #e9ecef;
    color: #495057;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    background: #0077b5;
    color: white;
}

/* ===== TIMELINE SECTION ===== */
.timeline-section {
    background: var(--bg-color);
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 60px auto 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-indigo), var(--accent-cyan));
    border-radius: 2px;
}

.timeline-item {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 80px;
    position: relative;
    width: 100%;
}

.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
}

.timeline-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    width: 44%;
    position: relative;
    border: 1px solid var(--gray-200);
    transition: all 0.4s var(--ease-out);
    text-align: left;
}

.timeline-item:hover .timeline-content {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-indigo);
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    border: 3px solid var(--primary-indigo);
    box-shadow: 0 0 0 4px var(--bg-color);
    z-index: 2;
    transform: translateY(-50%);
}

.timeline-item:nth-child(odd) .timeline-content::before {
    left: -60px;
}

.timeline-item:nth-child(even) .timeline-content::before {
    right: -60px;
}

.timeline-date {
    width: 44%;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--primary-indigo);
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}

.timeline-item:nth-child(odd) .timeline-date {
    padding-left: 60px;
    text-align: left;
}

.timeline-item:nth-child(even) .timeline-date {
    padding-right: 60px;
    text-align: right;
}

.timeline-content h3 {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: 12px;
    font-weight: 700;
}

.timeline-content p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}
/* ===== NEWS SECTION ===== */
.news-section {
    background: var(--gray-50);
}

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

.news-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gray-200);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue);
}

.news-img-wrap {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--gray-200);
}

.news-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.news-card:hover .news-img {
    transform: scale(1.05);
}

.news-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.news-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-link {
    margin-top: auto;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.news-link i {
    transition: transform 0.2s ease;
}

.news-link:hover i {
    transform: translateX(4px);
}

/* Skeleton Loading */
.news-skeleton {
    height: 400px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.news-skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.5) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 2s infinite;
}

:root[data-theme='dark'] .news-skeleton::after {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.05) 20%,
        rgba(255, 255, 255, 0.1) 60%,
        rgba(255, 255, 255, 0)
    );
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

.news-error {
    text-align: center;
    padding: 40px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: var(--radius-md);
    color: var(--accent-red);
}

/* ===== PROJECTS SECTION ===== */
.projects-section {
    /* inherits section */
}

/* Project Cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}

.project-card {
    background: var(--card-bg);
    padding: 36px 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(135deg, #0077b5, #00a8ff);
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue);
}

.project-card h3 {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin: 0 0 10px 0;
    font-weight: 600;
}

.project-subtitle {
    color: #666;
    font-size: 1rem;
    margin-bottom: 20px;
    font-weight: 500;
    border-left: 3px solid #0077b5;
    padding-left: 15px;
    line-height: 1.5;
}

.project-achievements {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.project-achievements li {
    padding: 10px 0;
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
}

.project-achievements li::before {
    content: '✓ ';
    color: #27ae60;
    font-weight: bold;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.tech-stack span {
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #2c3e50;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.tech-stack span:hover {
    background: #0077b5;
    color: white;
    border-color: #0077b5;
}

/* ===== SKILLS ROADMAP ===== */
.skills-roadmap {
    background: var(--gray-50);
}

.skills-roadmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 28px;
    margin-top: 50px;
}

.skill-path {
    background: var(--card-bg);
    padding: 36px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    border-top: 4px solid var(--primary-blue);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.skill-path:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-blue);
}

.skill-path h3 {
    font-size: 1.3rem;
    margin-bottom: 25px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.skill-path ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skill-path li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    padding-left: 35px;
    line-height: 1.6;
    font-size: 0.95rem;
    color: #555;
}

.skill-path li:last-child {
    border-bottom: none;
}

.skill-path li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: #0077b5;
    font-weight: bold;
    font-size: 0.85rem;
}

.skill-path strong {
    color: #2c3e50;
    font-weight: 600;
}

/* ===== CONTACT SECTION ===== */
.contact-section {
    /* inherits section padding */
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 50px;
    margin-top: 40px;
}

.contact-info {
    background: var(--card-bg);
    padding: 40px 36px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.contact-form {
    background: var(--card-bg);
    padding: 44px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.form-group {
    margin-bottom: 25px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--card-bg);
    transition: all 0.3s ease;
    color: var(--text-color);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 119, 181, 0.1);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
    font-size: 1.4rem;
    border: 2px solid var(--gray-200);
    background: var(--card-bg);
    color: var(--text-muted);
    text-decoration: none;
    flex-shrink: 0;
}

.social-links a:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Social brand colors */
.social-links a[href*="github.com"]:hover {
    border-color: #333;
    color: #333;
}

.social-links a[href*="linkedin.com"]:hover {
    border-color: #0077b5;
    color: #0077b5;
}

.social-links a[href*="x.com"]:hover,
.social-links a[href*="twitter.com"]:hover {
    border-color: #000000;
    color: #000000;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 900px) {
    .hero .container {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }
    .hero-content p {
        margin-left: auto;
        margin-right: auto;
    }
    .hero-cta {
        justify-content: center;
    }
    .achievement-highlights {
        justify-content: center;
    }
    .hero-image img {
        width: 240px;
        height: 290px;
    }
}

@media (max-width: 768px) {
    :root { --section-padding: 70px; }

    .section-title {
        font-size: 2.2rem;
        margin-bottom: 40px;
    }

    .teaching-grid,
    .projects-grid,
    .skills-roadmap-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 40px;
    }

    .teaching-card,
    .project-card,
    .skill-path {
        padding: 28px 24px;
    }

    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        flex-direction: column;
    }

    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 80px;
        margin-right: 0;
        width: calc(100% - 80px);
        text-align: left;
    }

    .timeline-item:nth-child(odd) .timeline-content::before,
    .timeline-item:nth-child(even) .timeline-content::before {
        left: -50px;
        right: auto;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .contact-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .achievement-highlights {
        gap: 10px;
    }

    .achievement-highlights span {
        font-size: 0.85rem;
        padding: 8px 15px;
    }
}

@media (max-width: 480px) {
    :root { --section-padding: 55px; }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .achievement-highlights span {
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    .teaching-card,
    .project-card,
    .skill-path {
        padding: 22px 18px;
    }

    .contact-info,
    .contact-form {
        padding: 28px 20px;
    }
}

/* Footer */
footer {
    background: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 30px 0;
}

footer p {
    font-size: 0.9rem;
    margin: 0;
}

/* ===== NEW PORTFOLIO STYLES ===== */
.featured-project {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    padding: 0;
    overflow: hidden;
    gap: 0;
}

.project-image-wrap {
    flex: 1.2;
    position: relative;
    overflow: hidden;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.featured-project:hover .project-img {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 119, 181, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.project-image-wrap:hover .project-overlay {
    opacity: 1;
}

.project-details {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-tag {
    font-size: 0.8rem;
    color: var(--primary-blue);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-desc {
    margin: 20px 0;
    color: var(--text-muted);
}

.repo-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: gap 0.3s;
}

.repo-link:hover {
    gap: 12px;
}

/* ===== BOOK SHOWCASE STYLES ===== */
.book-showcase {
    background: var(--bg-color);
    padding: 60px 0;
}

.showcase-grid {
    display: grid;
    grid-template-columns: 100px 1fr; /* Image takes less space */
    gap: 30px; 
    align-items: center;
}

.showcase-visual {
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.book-mockup {
    position: relative;
    transform: rotateY(-15deg);
    transition: transform 0.8s var(--ease-default);
}

.book-mockup:hover {
    transform: rotateY(0deg);
}

.book-mockup img {
    max-width: 120px; /* Minimal size */
    border-radius: 2px 5px 5px 2px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.1);
}

.book-spine {
    position: absolute;
    left: -10px;
    top: 0;
    bottom: 0;
    width: 20px;
    background: #333;
    transform: rotateY(-90deg);
    transform-origin: right;
    border-radius: 4px 0 0 4px;
}

.badge {
    display: inline-block;
    padding: 5px 15px;
    background: rgba(0, 119, 181, 0.1);
    color: var(--primary-blue);
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.75rem;
    margin-bottom: 20px;
}

.showcase-subtitle {
    font-size: 1.1rem;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.showcase-description {
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.showcase-features {
    margin-bottom: 35px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--text-color);
    font-weight: 500;
}

.feature-item i {
    color: var(--accent-green);
}

.showcase-cta {
    display: flex;
    align-items: center;
    gap: 15px; /* Tighter gap */
}

.showcase-socials {
    display: flex;
    gap: 12px;
}

.social-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    text-decoration: none;
    transition: all var(--transition-normal);
}

.social-btn.whatsapp { background-color: #25d366; }
.social-btn.facebook { background-color: #1877f2; }

.social-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
    box-shadow: var(--shadow-sm);
}

.text-left {
    text-align: left;
}

.text-left::after {
    left: 40px;
    transform: none;
}

@media (max-width: 992px) {
    .featured-project {
        flex-direction: column;
    }
    .showcase-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .text-left {
        text-align: center;
    }
    .text-left::after {
        left: 50%;
        transform: translateX(-50%);
    }
    .showcase-cta {
        justify-content: center;
    }
}

/* Modal Small Variant */
.modal-content.modal-sm {
    max-width: 600px;
}

/* Adjustments for the smaller section */
.book-showcase .section-title {
    font-size: 2rem;
    margin-bottom: 30px;
}