/**
 * Core Stylesheet & Visual Design System
 * Professor Portfolio & Research Group Portal
 */

/* ==========================================================================
   1. RESET & VARIABLE DEFINITIONS
   ========================================================================== */
:root {
    /* Color tokens - overridden dynamically by Theme compiler */
    --primary: #1e40af;
    --secondary: #3b82f6;
    --accent: #f59e0b;
    --bg: #ffffff;
    --surface: #f8fafc;
    --surface-solid: #f1f5f9;
    --surface-hover: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: rgba(0, 0, 0, 0.08);
    --header-bg: #1e40af;
    --header-text: #ffffff;
    --footer-bg: #111827;
    --footer-text: #94a3b8;
    --shadow: rgba(0, 0, 0, 0.05);
    --input-bg: #ffffff;
    --font-family: 'Outfit', sans-serif;
    
    /* Global presets */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Base layouts */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: var(--secondary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary);
}

/* ==========================================================================
   2. TYPOGRAPHY & HEADINGS
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; position: relative; padding-bottom: 10px; margin-bottom: 1.5rem; }
h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}
h3 { font-size: 1.5rem; }

/* ==========================================================================
   3. ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-fade {
    animation: fadeIn 0.8s ease forwards;
}

.animate-slide {
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- Premium Animation Engine --- */
@keyframes premiumFadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes premiumSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes premiumBounceScale {
    0% { transform: scale(0.9); opacity: 0; }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes glowBorder {
    0%, 100% { border-color: var(--border); box-shadow: 0 10px 30px var(--shadow); }
    50% { border-color: var(--secondary); box-shadow: 0 0 15px rgba(59, 130, 246, 0.4); }
}

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

/* Initialize classes */
.animate-fade-in { opacity: 0; }
.animate-slide-up { opacity: 0; }
.animate-bounce-scale { opacity: 0; }

/* Trigger only when animations are enabled */
body[data-animations-enabled="1"] .animate-fade-in {
    animation: premiumFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body[data-animations-enabled="1"] .animate-slide-up,
body[data-animations-enabled="1"] .card,
body[data-animations-enabled="1"] .hero-content,
body[data-animations-enabled="1"] .timeline-item {
    animation: premiumSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body[data-animations-enabled="1"] .animate-bounce-scale {
    animation: premiumBounceScale 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

body[data-animations-enabled="1"] .animate-glowing-border {
    animation: glowBorder 3s infinite ease-in-out;
}

body[data-animations-enabled="1"] .animate-floating-cards {
    animation: floatingCard 6s infinite ease-in-out;
}

/* Hover interactions when animations are enabled */
body[data-animations-enabled="1"] .card:hover,
body[data-animations-enabled="1"] .btn-primary:hover,
body[data-animations-enabled="1"] .auth-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px var(--shadow);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

/* Fallback for disabled animations */
body[data-animations-enabled="0"] .animate-fade-in,
body[data-animations-enabled="0"] .animate-slide-up,
body[data-animations-enabled="0"] .animate-bounce-scale,
body[data-animations-enabled="0"] .card,
body[data-animations-enabled="0"] .hero-content,
body[data-animations-enabled="0"] .timeline-item {
    opacity: 1 !important;
    transform: none !important;
}

/* ==========================================================================
   4. NAVIGATION & HEADER
   ========================================================================== */
.header-nav {
    background: var(--header-bg);
    color: var(--header-text);
    box-shadow: 0 4px 20px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--header-text) !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 24px;
}

.nav-links a {
    color: var(--header-text);
    opacity: 0.85;
    font-weight: 500;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.nav-links a:hover, .nav-links a.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.auth-btn {
    background: var(--accent);
    color: #fff !important;
    padding: 10px 20px !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   5. GLASSMORPHISM & CARD MODULES
   ========================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: 0 10px 30px var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border-color: var(--secondary);
}

/* Glassmorphism custom styling option */
.glass-enabled .card {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.glass-enabled.dark-mode-active .card {
    background: rgba(30, 41, 59, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* ==========================================================================
   6. HOMEPAGE HERO & STATISTICS
   ========================================================================== */
.hero-section {
    padding: 80px 0;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 48px;
    align-items: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-primary:hover {
    background: var(--secondary);
    color: #fff;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--surface-solid);
    color: var(--text);
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    border: 1px solid var(--border);
    cursor: pointer;
}
.btn-secondary:hover {
    background: var(--surface-hover);
    transform: translateY(-2px);
}

.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
}

.hero-image img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid var(--surface-solid);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* Stat Counter */
.stats-bar {
    background: var(--surface-solid);
    border-radius: var(--radius-lg);
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 24px;
    text-align: center;
    margin-bottom: 60px;
}

.stat-item {
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

body[data-animations-enabled="1"] .stat-item:hover {
    transform: translateY(-5px);
}

.stat-item:hover h3 {
    color: var(--secondary);
}

.stat-item h3 {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 4px;
    transition: var(--transition);
}

.stat-item p {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   7. LISTS & GRIDS (PUBLIC & DIRECTORY LAYOUTS)
   ========================================================================== */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 30px;
}

/* Timeline element */
.timeline {
    position: relative;
    border-left: 3px solid var(--border);
    padding-left: 30px;
    margin-left: 15px;
    transition: border-color 0.4s ease;
}

.timeline:hover {
    border-color: var(--primary);
}

.timeline-item {
    position: relative;
    margin-bottom: 35px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 18px 22px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px var(--shadow);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

.timeline-item:hover {
    transform: translateX(5px) scale(1.01);
    box-shadow: 0 10px 20px var(--shadow);
    border-color: var(--primary);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -41px;
    top: 22px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    border: 4px solid var(--bg);
    box-shadow: 0 0 0 3px var(--border);
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover::before {
    transform: scale(1.2);
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--primary);
}

.timeline-date {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    background: rgba(245, 158, 11, 0.1);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    text-transform: uppercase;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.timeline-item:hover .timeline-date {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

/* ==========================================================================
   8. FORMS & INPUT CONTROLS
   ========================================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ==========================================================================
   9. ADMIN SIDEBAR LAYOUT
   ========================================================================== */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 80px);
}

.admin-sidebar {
    background: var(--surface-solid);
    border-right: 1px solid var(--border);
    padding: 30px 20px;
}

.admin-menu {
    list-style: none;
}

.admin-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-weight: 500;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.admin-menu a:hover, .admin-menu a.active {
    color: var(--text);
    background: var(--surface-hover);
}

.admin-content {
    padding: 40px;
    overflow-y: auto;
}

/* ==========================================================================
   10. TABLES
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: var(--surface);
}

th, td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--surface-solid);
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--surface-hover);
}

/* ==========================================================================
   11. NOTIFICATIONS & ALERTS
   ========================================================================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending {
    background: #fef3c7;
    color: #d97706;
}

.badge-approved {
    background: #d1fae5;
    color: #059669;
}

.badge-rejected {
    background: #fee2e2;
    color: #dc2626;
}

/* Footer layout */
footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 40px 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

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

/* ==========================================================================
   12. RESPONSIVENESS AND DEVICE COMPATIBILITY (DESKTOP, TABLET, MOBILE)
   ========================================================================== */

/* Layout structure class for home page column splits */
.home-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 48px;
}

/* Tablet view styling */
@media (max-width: 1024px) {
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 50px 0;
        gap: 30px;
    }
    .hero-image {
        order: -1;
    }
    .hero-image img, .hero-image div {
        width: 260px;
        height: 260px;
    }
    .hero-content h1 {
        font-size: 2.8rem;
    }
    .home-grid {
        grid-template-columns: 1fr;
        gap: 35px;
    }
    .grid-3 {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .admin-layout {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 20px;
    }
    .admin-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    .admin-menu li {
        flex: 1 1 200px;
    }
    .admin-menu a {
        margin-bottom: 0;
    }
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .footer-content div {
        text-align: center !important;
    }
}

/* Mobile view styling */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 20px 24px;
        gap: 15px;
    }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    .nav-links a {
        font-size: 13px;
        padding: 6px 10px;
    }
    .hero-content h1 {
        font-size: 2.2rem;
    }
    .hero-content p {
        font-size: 1rem;
    }
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .hero-actions a {
        text-align: center;
        justify-content: center;
    }
    .stats-bar {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        padding: 20px;
    }
    .stat-item h3 {
        font-size: 1.8rem;
    }
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .admin-content {
        padding: 20px;
    }
}

/* ==========================================================================
   12.5. SOCIAL & RESEARCH LINKS POLISH
   ========================================================================== */
/* Profile Detail View Links - Forced 3 Columns Grid Layout */
.profile-social-links {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
}
@media (max-width: 768px) {
    .profile-social-links {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 480px) {
    .profile-social-links {
        grid-template-columns: 1fr !important;
    }
}
.profile-social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text) !important;
    font-size: 12.5px;
    font-weight: 500;
    transition: var(--transition);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-social-link:hover {
    background: var(--surface-hover);
    border-color: var(--secondary);
    transform: translateY(-2px);
}

/* Roster Grid Team Cards Social Links */
.roster-social-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 16px;
}
.roster-social-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 50%;
    transition: var(--transition);
    text-decoration: none;
}
.roster-social-icon:hover {
    background: var(--surface-hover);
    border-color: var(--secondary);
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 4px 10px var(--shadow);
}

/* ==========================================================================
   13. PRINT-READY CITATION STYLESHEET
   ========================================================================== */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
    }
    .header-nav, footer, .btn-primary, .btn-secondary, .admin-sidebar, .form-group, .filters-bar {
        display: none !important;
    }
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-bottom: 1.5rem !important;
        page-break-inside: avoid;
    }
    h2::after {
        display: none !important;
    }
}

/* Layout Grids */
.profile-layout-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: stretch;
    margin-bottom: 50px;
    width: 100%;
}
/* Bigger circular profile photos via CSS */
.scholar-round-img {
    width: 260px !important;
    height: 260px !important;
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid var(--surface-solid);
    display: block;
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
}
.scholar-round-fallback {
    width: 260px !important;
    height: 260px !important;
    border-radius: 50%;
    background: var(--surface);
    border: 6px solid var(--surface-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
}

.contact-layout-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 50px;
    align-items: start;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

/* Member Header Flex Layout - Photo Left, Details Right for BOTH Desktop & Mobile */
.member-header-flex {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 20px;
    width: 100%;
}

.member-avatar-box {
    flex-shrink: 0;
}

.member-avatar-img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--surface-solid);
    display: block;
    box-shadow: 0 10px 25px var(--shadow);
}

.member-avatar-fallback {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: var(--surface-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    box-shadow: 0 10px 25px var(--shadow);
}

.member-details-box {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.member-name-heading {
    font-size: 24px;
    margin: 0 0 6px 0;
    color: var(--primary);
    font-weight: 700;
    line-height: 1.2;
}

/* ==========================================================================
   14. COMPREHENSIVE MOBILE RESPONSIVE STYLES
   ========================================================================== */
@media (max-width: 1024px) {
    .contact-layout-grid,
    .grid-2,
    .grid-3,
    div[style*="grid-template-columns: 320px 1fr"],
    div[style*="grid-template-columns: 0.8fr 1.2fr"],
    div[style*="grid-template-columns: 1.2fr 0.8fr"],
    div[style*="grid-template-columns: 1fr 1.5fr"] {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        gap: 24px !important;
    }
    .hero-section {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
        text-align: center !important;
    }
    .hero-content h1 {
        font-size: 2.5rem !important;
    }
    .hero-actions {
        justify-content: center !important;
    }
}

@media (max-width: 768px) {
    /* Prevent horizontal page compression or overflow */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    .container {
        padding-left: 16px !important;
        padding-right: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Keep Photo Left & Details Right Side-by-Side on Mobile */
    .scholar-header-container {
        grid-template-columns: auto 1fr !important;
        gap: 12px !important;
    }

    .scholar-photo-box {
        padding: 10px !important;
    }

    .scholar-round-img,
    .scholar-round-fallback {
        width: 110px !important;
        height: 110px !important;
        font-size: 44px !important;
    }

    .scholar-details-box {
        padding: 14px 16px !important;
    }

    .scholar-name-heading {
        font-size: 17px !important;
        margin-bottom: 4px !important;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 16px !important;
        box-sizing: border-box !important;
    }

    .hero-content h1 {
        font-size: 2rem !important;
        line-height: 1.25 !important;
    }

    .hero-content p {
        font-size: 1rem !important;
    }

    .hero-image img {
        width: 220px !important;
        height: 220px !important;
    }

    .hero-actions {
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .hero-actions .btn-primary,
    .hero-actions .btn-secondary {
        width: 100% !important;
        justify-content: center !important;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr) !important;
        padding: 20px 15px !important;
        gap: 16px !important;
    }

    /* Fixed natural section heights without clipping */
    section {
        height: auto !important;
        min-height: auto !important;
    }

    /* Card padding optimization on mobile */
    .card {
        padding: 18px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Form controls full width */
    .form-control, input, select, textarea {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Mobile media scaling */
    img, iframe, video {
        max-width: 100% !important;
        height: auto !important;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.75rem !important;
    }

    .stats-bar {
        grid-template-columns: 1fr !important;
    }

    .stat-item h3 {
        font-size: 1.8rem !important;
    }
}
