:root {
    --primary-color: #2563eb; 
    --secondary-color: #324563; 
    --text-color: #333;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --accent-red: #dc2626;
}

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

body { 
    font-family: var(--font-main); 
    line-height: 1.6; 
    color: var(--text-color); 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- CONTAINERS (Reverted to your original preference) --- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* --- KEY FIX HERE --- */
.container-left { 
    margin-left: 80px;          /* STRICT LEFT ALIGNMENT */
    width: calc(100% - 120px);  /* Expands to the right (Total width - left margin - small right buffer) */
    max-width: 1600px;          /* Allowed to go much wider now */
    padding-right: 20px;        /* Small gap on the right edge */
}

.section { padding: 60px 0; }
section { flex: 1; } 
.bg-light { background-color: var(--bg-light); }
.highlight { color: var(--primary-color); }

/* --- GLOBAL TEXT JUSTIFICATION --- */
p, li {
    text-align: justify;
}

/* --- NAVBAR --- */
.navbar {
    background: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky; top: 0; z-index: 1000;
    width: 100%;
}

.navbar .container {
    max-width: 100%;
    width: 100%;
    padding: 0 30px;
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    height: 70px;
}

.navbar-brand { display: flex; align-items: center; gap: 10px; }
.logo-img { height: 50px; width: auto; }

.nav-links { display: flex; gap: 20px; }
.nav-links a { font-weight: 500; transition: 0.3s; }
.nav-links a:hover { color: var(--primary-color); }
.nav-links a.active { color: var(--primary-color); border-bottom: 2px solid var(--primary-color); }

/* --- HERO --- */
.hero { display: flex; align-items: center; justify-content: center; padding: 80px 0; }
.hero-content { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.hero-text h1 { font-size: 3rem; line-height: 1.2; margin-bottom: 20px; }
.hero-image img { 
    max-width: 350px; width: 100%; height: auto; 
    border-radius: 15px; box-shadow: 0 10px 20px rgba(0,0,0,0.1); 
    display: block; margin: 0 auto;
}

/* Space between hero paragraph and buttons */
.hero-btns { margin-top: 20px; }

/* --- BUTTONS --- */
.btn { display: inline-block; padding: 5px 25px; border-radius: 5px; margin-right: 10px; font-weight: bold; cursor: pointer; }
.btn-primary { background: var(--primary-color); color: var(--white); border: none; }
.btn-secondary { background: var(--secondary-color); color: var(--white); border: none; }

/* --- BOTTOM NAV --- */
.bottom-nav { text-align: left; padding: 20px 0; margin-top: 20px; border-top: 1px solid #eee; }
.bottom-nav .btn { width: auto; min-width: 100px; text-align: center; font-size: 1rem; line-height: 1.4; }

/* --- PAGE HEADERS --- */
.page-header-bar { 
    background: var(--secondary-color); 
    color: var(--white); 
    padding: 4px 0;
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}
.page-header-bar h1 { margin: 0; font-size: 1.8rem; }

/* --- CARDS & MISC --- */
.card { background: var(--white); padding: 20px; margin-bottom: 20px; border-left: 5px solid var(--primary-color); box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.video-card { background: var(--white); border-radius: 8px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.video-info { padding: 15px; }

.form-group { margin-bottom: 15px; }
.form-group input, .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 5px; }

.skills-container { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.skill-tag { background: #e2e8f0; padding: 5px 15px; border-radius: 20px; font-size: 0.9rem; font-weight: 600; color: var(--secondary-color); }

.footer { background: var(--secondary-color); color: #ccc; text-align: center; padding: 6px 0; margin-top: auto; font-size: 0.9rem; }
.footer p {
    text-align: center;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .container-left { margin-left: 20px; width: auto; padding-right: 20px; } /* Reset on mobile */
    .hero-content { grid-template-columns: 1fr; text-align: center; }
    .nav-links { font-size: 0.9rem; gap: 10px; }
    .navbar .container { flex-wrap: wrap; height: auto; padding: 10px 20px; }
    .nav-links { width: 100%; justify-content: center; margin-top: 10px; }
    
    /* Research Page Mobile */
    .patent-layout { flex-direction: column; }
    .patent-media { width: 100%; margin-top: 15px; text-align: center; }
    .carousel-container { height: 250px; } /* Smaller slideshow on phone */
}

/* =========================================
   RESEARCH PAGE SPECIFIC STYLES
   ========================================= */

/* Patent Layout */
.patent-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}
.patent-text { flex: 1; }
.patent-media { flex: 0 0 180px; text-align: center; }

.patent-img-small {
    width: 100%;
    max-width: 180px;
    border: 1px solid #ddd;
    padding: 3px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 4px;
    transition: transform 0.2s;
    cursor: pointer;
}
.patent-img-small:hover { transform: scale(1.5); }

.caption { display: block; font-size: 0.75rem; color: #666; margin-top: 5px; }
.meta-tag {
    background: #f1f5f9;
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
    font-size: 0.85rem;
    color: #444;
    border-left: 3px solid var(--secondary-color);
}

/* Publication List Styling (Two-Line Format) */
.pub-list {
    list-style-type: disc; /* Standard bullet point */
    padding-left: 20px;    /* Indentation */
    margin-top: 15px;
}

.pub-list li {
    margin-bottom: 25px;   /* Space between different papers */
    padding-left: 5px;     /* Space between bullet and text */
}

/* Line 1: The Paper Title */
.pub-list strong {
    display: inline;       /* Keeps it aligned with the bullet */
    font-size: 1.05rem;
    color: var(--secondary-color); /* Dark Blue/Grey */
    font-weight: 700;
    line-height: 1.4;
}

/* Line 2: The Metadata (Journal + DOI) */
.pub-list .paper-meta {
    display: block;        /* Forces this to the NEXT line */
    margin-top: 6px;       /* Gap between Title and Journal */
    font-size: 0.95rem;
    color: #555;           /* Grey color */
}

.pub-list .paper-meta em {
    font-style: italic;
    margin-right: 10px;    /* Space before DOI link */
}

.pub-list .paper-meta a {
    font-style: normal;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    background-color: #f0f7ff; /* Light blue background for link */
    padding: 2px 6px;
    border-radius: 4px;
}

.pub-list .paper-meta a:hover {
    text-decoration: underline;
}

/* =========================================
   NEW: CERTIFICATE CAROUSEL STYLES
   ========================================= */
.carousel-container {
    position: relative;
    width: 100%;
    max-width: 700px; /* Limits width so it doesn't look too big */
    height: 450px;    /* Fixed height for the viewing area */
    margin: 20px auto; /* Centers the container */
    overflow: hidden;
    border: 1px solid #ddd;
    background: #f8f9fa; /* Light gray background */
    border-radius: 8px;
}

.carousel-img {
    position: absolute; /* Stacks images on top of each other */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensures the whole image fits inside without stretching */
    opacity: 0;          /* Hidden by default */
    transition: opacity 1s ease-in-out; /* Smooth fade transition */
    padding: 10px;
}

/* The class that makes an image visible */
.carousel-img.active {
    opacity: 1;
}
/* =========================================
   GALLERY PAGE STYLES
   ========================================= */

/* Tab Control Buttons */
.gallery-controls {
    text-align: center;
    margin-bottom: 30px;
}

.gallery-btn {
    padding: 10px 30px;
    margin: 0 5px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-btn:hover {
    background: #e0e7ff;
}

.gallery-btn.active {
    background: var(--primary-color);
    color: var(--white);
}

/* Visibility Toggles */
.gallery-section {
    display: none; /* Hidden by default */
    animation: fadeIn 0.5s ease-in-out;
}

.gallery-section.active {
    display: block; /* Show when active */
}

/* Photo Grid Layout */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.photo-card {
    background: var(--white);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.photo-card:hover {
    transform: translateY(-5px);
}

.photo-card img {
    width: 100%;
    height: 200px;
    object-fit: cover; /* Ensures photos are all same size */
    border-radius: 5px;
    cursor: pointer;
}

/* Animation for smooth switching */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}