/* Ensure all elements use border-box for better mobile layout */
html {
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}
/* Color Palette - Professional Education Light Theme */
:root {
  --primary-color: #1B6B4D;     /* Main green shade */
  --primary-light: #338A6B;     /* Lighter variant */
  --primary-dark: #0D503A;      /* Darker variant */
  --accent-color: #4CAF82;      /* Accent green */
  --surface-color: #FFFFFF;     /* White surface color */
  --background-color: #F8FBF9;  /* Very light green background */
  --text-primary: #1A1C19;      /* Dark text */
  --text-secondary: #424940;    /* Secondary text */
  --error-color: #BA1A1A;       /* Error state */
  --outline-color: #72796F;     /* Outline/border color */
  --warm-brown: #8B5A3C;        /* Warm brown for accents */
  --gold-accent: #D4AF37;       /* Gold for highlights */
  --card-background: #FFFFFF;   /* Card background */
  --section-background: #F0F7F3; /* Light green section background */
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -ms-overflow-style: -ms-autohiding-scrollbar;
    overflow-y: scroll;
    overflow-x: hidden;
    height: 100%;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background-color);
    color: var(--text-primary);
    overflow-x: hidden;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
    height: 100%;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    font-weight: 400;
    line-height: 1.6;
}

/* Custom scrollbar for Windows */
body::-webkit-scrollbar {
    width: 8px;
}

body::-webkit-scrollbar-track {
    background: transparent;
}

body::-webkit-scrollbar-thumb {
    background: var(--warm-brown);
    border-radius: 4px;
    opacity: 0.6;
}

body::-webkit-scrollbar-thumb:hover {
    background: var(--warm-brown);
    opacity: 0.8;
}

/* Layout */
.page-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

main {
    position: relative;
    min-height: 100vh;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Mobile touch improvements for navigation buttons */
@media (max-width: 768px) {
    .nav-button {
        /* Add a slight delay to prevent accidental activation during scrolling */
        transition: all 0.2s ease, background-color 0.1s ease 0.05s;
    }
    
    .nav-button:active {
        /* Only activate visual feedback after a brief delay */
        transition-delay: 0.05s;
    }
    
    /* Add visual feedback for intentional touches */
    .nav-button:hover:active {
        background-color: var(--primary-dark, #155a42);
        transform: scale(0.98);
    }
}
.navigation-buttons {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
}

.nav-button {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(27, 107, 77, 0.2);
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.nav-button:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 107, 77, 0.3);
}

.nav-button:active {
    transform: translateY(0px);
    box-shadow: 0 2px 6px rgba(27, 107, 77, 0.2);
}

/* Disable animations on Android for better performance */
.android-device .nav-button:hover,
.android-device .nav-button:active,
.android-device .card:hover,
.android-device .prev:hover,
.android-device .next:hover,
.android-device button:hover,
.android-device a:hover {
    transform: none !important;
    transition: none !important;
}

/* Android-specific: Remove ALL transitions and animations from navigation buttons */
.android-device .nav-button,
.android-device a[class*="nav-button"],
.android-device div[style*="transition"] .nav-button,
.android-device a[style*="transition"] {
    transition: none !important;
    transform: none !important;
    animation: none !important;
    -webkit-transform: none !important;
    -webkit-transition: none !important;
    -webkit-animation: none !important;
}

/* Android-specific layout: Consistent sizing for all image containers */
.android-device .slideshow-container,
.android-device .video-slideshow-container,
.android-device .card,
.android-device .subsection,
.android-device .multimedia-grid-item,
.android-device .event-section,
.android-device .semester-section {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 1.5rem 0 !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
}

.android-device .content-grid,
.android-device .multimedia-grid-container,
.android-device .training-programs-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    width: 100% !important;
}

/* Section Styles */
section {
    width: 100%;
    padding: 4rem 2rem;
    margin: 2rem 0;
    background: var(--section-background);
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

section h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 2.5rem;
    text-align: center;
    font-weight: 700;
    position: relative;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--primary-light);
    border-radius: 2px;
}

/* Hero Page */
.hero-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: var(--section-background);
    border: none !important;
    box-shadow: none !important;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.hero-container {
    display: flex;
    align-items: center;
    gap: clamp(2rem, 4vw, 4rem);
    max-width: 1100px;
    width: 100%;
    padding: clamp(1rem, 3vw, 2rem);
    margin: 0 auto;
    justify-content: center;
}

.profile-image {
    flex: 0 0 auto;
}

.profile-photo-placeholder, .profile-photo {
    width: 400px;
    height: 500px;
    border: 4px solid var(--warm-brown);
    border-radius: 12px;
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.2),
        0 0 0 4px rgba(139, 90, 60, 0.1);
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-photo {
    background: none;
}

.profile-photo-placeholder {
    background-image: url('assets/images/profile/profile.jpg');
    background-size: cover;
    background-position: center;
}

.profile-photo-placeholder span {
    color: transparent;
    font-size: 1.2rem;
    font-weight: 500;
}

.hero-content {
    flex: 1;
    padding-left: 2rem;
}

.portfolio-label {
    font-size: 1.3rem;
    color: #666;
    margin: 0 0 1rem 0;
    font-weight: 400;
}

.hero-name {
    font-size: 5rem;
    font-weight: 900;
    color: var(--primary-color);
    margin: 0 0 1rem 0;
    line-height: 0.9;
    letter-spacing: -0.02em;
    min-height: 9rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#typewriter-name {
    display: inline-block;
    position: relative;
    white-space: normal;
    word-break: break-word;
}

.cursor {
    animation: blink 1s infinite;
    color: var(--warm-brown);
    display: inline;
    font-weight: 300;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hero-title {
    font-size: 1.8rem;
    color: #666;
    margin: 0 0 1.5rem 0;
    font-weight: 400;
}

.hero-description {
    font-size: 1.2rem;
    color: #666;
    margin: 0 0 2rem 0;
    line-height: 1.5;
    font-weight: 400;
}

.hero-contact {
    font-size: 1.2rem;
    color: #888;
    margin: 0;
    font-weight: 400;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 1rem;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

/* Cards */
.card {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: 200px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(27, 107, 77, 0.1);
}

.card h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    flex-grow: 1;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(27, 107, 77, 0.15);
    border-color: var(--accent-color);
}

.workshop-image {
    width: 100%;
    height: auto;
    min-height: 300px;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    margin-top: 1rem;
}

.card:has(.workshop-image) {
    padding: 1.5rem;
    width: 100%;
}

/* Profile Content */
.profile-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-background);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(27, 107, 77, 0.1);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.profile-info p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
    color: var(--text-secondary);
}

.profile-info strong {
    color: var(--primary-color);
    font-weight: 600;
    min-width: 140px;
    display: inline-block;
}

/* Semester Section */
.semester-section {
    margin: 2rem 0;
    padding: 2rem;
    background-color: var(--card-background);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid rgba(27, 107, 77, 0.1);
}

.semester-section h3 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 600;
    text-align: left;
    padding-left: 1rem;
    border-left: 4px solid var(--primary-color);
}

/* Event Section */
.event-section {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    min-height: auto;
    padding: 2rem 0;
    position: relative;
}

.event-section h4 {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    padding: 1rem;
    position: relative;
}

.event-section h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

/* Media Container */
.media-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0;
    min-height: 80vh;
}

.media-container > div {
    display: flex;
    flex-direction: column;
    background: var(--card-background);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    height: auto;
    min-height: 600px;
    border: 1px solid rgba(27, 107, 77, 0.1);
}

/* Digital Resources Container */
.digital-resources-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0;
    min-height: 70vh;
    align-items: start;
}

.description-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--card-background);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid rgba(27, 107, 77, 0.1);
    height: fit-content;
    max-height: 500px;
    align-self: center;
}

.description-left h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.8rem 0;
    line-height: 1.3;
}

.description-left p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
    text-align: justify;
}

.media-right {
    display: flex;
    flex-direction: column;
    background: var(--card-background);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    height: auto;
    min-height: 600px;
    border: 1px solid rgba(27, 107, 77, 0.1);
}

/* Slideshow */
.slideshow-container, .video-slideshow-container {
    flex: 1;
    position: relative;
    background: var(--background-color);
    padding: 0.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
}

.media-section-title {
    font-size: 2rem;
    color: var(--primary-color);
    text-align: center;
    margin: 2rem 0 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.slides {
    display: flex;
    overflow: hidden;
    border-radius: 12px;
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    flex: 1;
    min-height: 500px;
}

.slides img, .slides video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    object-fit: contain;
    background: #000;
}

.slides img.active, .slides video.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Navigation Buttons */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: 50px;
    height: 50px;
    padding: 10px;
    margin-top: -25px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: all 0.3s ease;
    border-radius: 25px;
    user-select: none;
    background: var(--primary-color);
    border: 2px solid rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    backdrop-filter: blur(4px);
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

.prev:hover, .next:hover {
    background-color: var(--primary-light);
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.prev:active, .next:active {
    transform: scale(0.95);
    background-color: var(--primary-dark);
}

/* Sticky Header */
.sticky-header {
    display: none;
}

@media (min-width: 1024px) {
    .sticky-header {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(139, 90, 60, 0.2);
        padding: 1rem 0;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 2px 20px rgba(139, 90, 60, 0.15);
        display: flex;
        justify-content: center;
        width: 100%;
    }
}

.sticky-header.visible {
    transform: translateY(0);
}

.header-content {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    gap: 1rem;
    padding: 0 20px;
}

.header-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-image: url('assets/images/profile/profile.jpg');
    background-size: cover;
    background-position: center;
    border: 2px solid var(--warm-brown);
    box-shadow: 0 2px 8px rgba(139, 90, 60, 0.1);
}

.header-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--warm-brown);
    margin: 0;
    letter-spacing: 0.5px;
}

.header-title {
    font-size: 0.9rem;
    color: #6b5b73;
    margin: 0;
    margin-left: auto;
    font-weight: 500;
}

/* MOBILE RESPONSIVE STYLES - Enhanced Android Support */
@media (max-width: 768px) {
    /* Base mobile optimizations */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
    
    /* Hero Section */
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
        padding: 1rem;
        max-width: 98vw;
    }
    
    .hero-content {
        padding-left: 0;
    }
    
    .profile-photo-placeholder, .profile-photo {
        width: 280px;
        height: 350px;
    }
    
    .hero-name {
        font-size: 3.5rem;
        min-height: 7rem;
    }
    
    /* Navigation buttons mobile optimization */
    .navigation-buttons {
        margin-top: 1.5rem;
        gap: 0.5rem;
        width: 100%;
        max-width: 320px;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    
    .nav-button {
        padding: 14px 16px;
        font-size: 0.95rem;
        font-weight: 600;
        min-height: 44px;
        border-radius: 10px;
        box-sizing: border-box;
        margin-bottom: 0;
        width: 100%;
        max-width: 99vw;
        touch-action: manipulation;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
        text-align: center;
        /* Prevent accidental activation during scrolling */
        pointer-events: auto;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        /* Add a slight delay to prevent accidental activation during scrolling */
        transition: all 0.2s ease, background-color 0.1s ease 0.05s;
    }
    
    .nav-button:active {
        /* Only activate visual feedback after a brief delay */
        transition-delay: 0.05s;
        background-color: var(--primary-dark, #155a42);
        transform: scale(0.98);
    }
    
    /* Semester page navigation mobile fix */
    .page-wrapper main > div:first-child > div:first-child {
        position: static !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        margin-bottom: 2rem !important;
        padding: 1rem !important;
    }
    
    .page-wrapper main > div:first-child > div:first-child .nav-button {
        margin: 0 !important;
        width: 100% !important;
        max-width: 300px !important;
        text-align: center !important;
        display: block !important;
    }
    
    /* Semester page header mobile optimization */
    .page-wrapper main > div:first-child h1 {
        font-size: 4rem !important;
        line-height: 1.1 !important;
        margin: 1rem 0 !important;
    }
    
    .page-wrapper main > div:first-child p {
        font-size: 1.2rem !important;
        margin: 0.5rem 0 !important;
        padding: 0 1rem !important;
    }
    
    /* Sections */
    section {
        padding: 2rem 1rem;
        margin: 1rem 0;
        border-radius: 16px;
    }
    
    section h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
        padding: 0 1rem;
    }
    
    /* Content Grid */
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0.5rem;
    }
    
    .card {
        padding: 1.5rem;
        min-height: auto;
        border-radius: 12px;
    }
    
    /* Media Container - OPTIMIZED FOR MOBILE */
    .media-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
        margin: 0;
        min-height: auto;
    }
    
    .media-container > div {
        padding: 0.5rem;
        margin: 0.5rem 0;
        min-height: auto;
        background: rgba(255, 255, 255, 0.8);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border-radius: 12px;
    }
    
    /* Digital Resources Container - MOBILE */
    .digital-resources-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
        margin: 0;
        min-height: auto;
    }
    
    .description-left {
        padding: 1rem;
        margin: 0.5rem 0;
        min-height: auto;
        order: 2;
    }
    
    .description-left h4 {
        font-size: 1.2rem;
        margin: 0 0 0.75rem 0;
        line-height: 1.3;
    }
    
    .description-left p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .media-right {
        padding: 0.5rem;
        margin: 0.5rem 0;
        min-height: auto;
        order: 1;
        background: rgba(255, 255, 255, 0.8);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border-radius: 12px;
    }
    
    /* Slideshow - OPTIMIZED FOR MOBILE */
    .slideshow-container, .video-slideshow-container {
        padding: 0.25rem;
        margin: 0.5rem 0;
        border-radius: 8px;
        background: transparent;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        height: auto;
        min-height: 300px;
    }
    
    .slides {
        min-height: 40vh;
        border-radius: 8px;
        margin: 0;
        background: #000;
    }
    
    /* Video optimizations for mobile */
    .slides video {
        width: 100%;
        height: 100%;
        object-fit: contain;
        background: #000;
    }
    
    .media-section-title {
        font-size: 1.5rem;
        margin: 1rem 0 0.5rem;
        padding: 0;
    }
    
    /* Navigation Buttons */
    .prev, .next {
        width: 40px;
        height: 40px;
        margin-top: -20px;
        font-size: 18px;
        border-radius: 20px;
    }
    
    .prev {
        left: 10px;
    }
    
    .next {
        right: 10px;
    }
    
    /* Event Section */
    .event-section {
        padding: 0 1rem;
        margin: 1rem 0;
    }
    
    /* Semester Section */
    .semester-section {
        margin: 1rem 0;
        padding: 1rem;
        border-radius: 12px;
    }
    
    .semester-section h3 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    /* Profile */
    .profile-content {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .profile-info p {
        font-size: 0.95rem;
    }
    
    .profile-info strong {
        min-width: 100px;
    }
    
    /* Workshop Image */
    .workshop-image {
        height: 250px;
    }
    
    /* Main */
    main {
        padding: 1rem;
    }
    
    body {
        overflow-x: hidden;
    }
    
    .page-wrapper {
        max-width: 100vw;
        overflow-x: hidden;
    }
}

@media (max-width: 480px) {
    /* Ultra Mobile Optimization */
    .hero-container {
        gap: 1.5rem;
        padding: 0.5rem;
        max-width: 99vw;
    }
    
    .profile-photo-placeholder, .profile-photo {
        width: 240px;
        height: 320px;
    }
    
    .hero-name {
        font-size: 3rem;
        min-height: 6rem;
    }
    
    /* Media - Maximum Space for Images */
    .media-container > div {
        padding: 0.25rem;
        margin: 0.25rem 0;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 8px;
    }
    
    /* Digital Resources - Ultra Mobile */
    .digital-resources-container {
        gap: 0.5rem;
        margin: 0;
    }
    
    .description-left {
        padding: 0.75rem;
        margin: 0.25rem 0;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 8px;
    }
    
    .description-left h4 {
        font-size: 1.1rem;
        margin: 0 0 0.5rem 0;
        line-height: 1.2;
    }
    
    .description-left p {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .media-right {
        padding: 0.25rem;
        margin: 0.25rem 0;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 8px;
    }
    
    .slideshow-container, .video-slideshow-container {
        padding: 0.1rem;
        margin: 0.25rem 0;
        min-height: 250px;
        box-shadow: none;
        background: var(--background-color);
    }
    
    .slides {
        min-height: 35vh;
        border-radius: 6px;
    }
    
    .media-section-title {
        font-size: 1.3rem;
        margin: 0.5rem 0 0.25rem;
    }
    
    .event-section {
        padding: 0 0.5rem;
        margin: 0.5rem 0;
    }
    
    .semester-section {
        padding: 0.75rem;
        margin: 0.5rem 0;
        border-radius: 8px;
    }
    
    /* Navigation Buttons */
    .prev, .next {
        width: 36px;
        height: 36px;
        margin-top: -18px;
        font-size: 16px;
        border-radius: 18px;
    }
    
    .prev {
        left: 5px;
    }
    
    .next {
        right: 5px;
    }
    
    section {
        padding: 1.5rem 0;
    }
    
    section > h2 {
        font-size: 1.6rem;
        padding: 0 0.5rem;
    }
}

/* Base mobile device optimizations */
.mobile-device {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.android-device .slides video {
    /* Android-specific video optimizations */
    object-fit: contain;
}

.ios-device {
    /* iOS-specific optimizations */
    -webkit-overflow-scrolling: touch;
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
    * {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    .slides img, .slides video {
        will-change: transform, opacity;
    }
    
    .card {
        will-change: transform;
    }
    
    /* Optimize hover effects for touch devices */
    .card:hover {
        transform: none;
    }
    
    .card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* Ultra-small screens optimization */
@media screen and (max-width: 360px) {
    .media-container > div {
        padding: 0;
        margin: 0;
        background: transparent;
    }
    
    .slideshow-container, .video-slideshow-container {
        padding: 0;
        margin: 0;
        background: transparent;
    }
    
    .slides {
        min-height: 40vh;
        margin: 0;
    }
    
    .media-section-title {
        font-size: 1.1rem;
        margin: 0.1rem 0;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .card:hover {
        transform: none;
    }
    
    .card:active {
        transform: scale(0.98);
    }
    
    .prev, .next {
        padding: 12px;
        min-width: 44px;
        min-height: 44px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
    .slides img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    .prev, .next {
        border: 2px solid var(--primary-color);
    }
}

/* Windows specific - Force light theme */
@media (min-width: 769px) {
    :root {
        --background-color: #F8FBF9 !important;
        --section-background: #F0F7F3 !important;
        --card-background: #FFFFFF !important;
        --text-primary: #1A1C19 !important;
        --text-secondary: #424940 !important;
    }
    
    body {
        background: var(--background-color) !important;
        color: var(--text-primary) !important;
    }
    
    section {
        background: var(--section-background) !important;
    }
    
    .card, .semester-section, .profile-content, .media-container > div, .description-left, .media-right {
        background: var(--card-background) !important;
        color: var(--text-primary) !important;
    }
}

/* Dark mode support - Android only */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    :root {
        --background-color: #1a1a1a;
        --section-background: #2d2d2d;
        --card-background: #2d2d2d;
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
    }
    
    .card {
        background: var(--card-background);
        color: var(--text-primary);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    section {
        background: var(--section-background);
    }
    
    .semester-section {
        background: var(--card-background);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .profile-content {
        background: var(--card-background);
        color: var(--text-primary);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .media-container > div {
        background: var(--card-background);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .description-left, .media-right {
        background: var(--card-background);
        color: var(--text-primary);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Android/iOS specific fixes - Enhanced */
@supports (-webkit-touch-callout: none) {
    html, body {
        height: -webkit-fill-available;
        overscroll-behavior-y: none;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .hero-page {
        width: 100%;
        left: 0;
        transform: none;
        min-height: -webkit-fill-available;
    }
    
    .hero-container {
        width: 100%;
        padding: 1rem;
        transform: none;
    }
    
    .media-container {
        width: 100%;
        left: 0;
        transform: none;
        padding: 1rem;
    }
    
    .slideshow-container {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    .slides img, .slides video {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
    }

    .prev, .next {
        padding: 15px;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
    }
    
    /* Enhanced touch targets */
    .nav-button {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        user-select: none;
        -webkit-user-select: none;
    }
    
    /* Fix viewport issues on mobile browsers */
    .page-wrapper {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        position: relative;
    }
}

/* Android Chrome specific optimizations */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: .001dpcm) {
    .slides video {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }
    
    /* Fix Android Chrome video controls */
    .slides video::-webkit-media-controls {
        overflow: visible !important;
    }
    
    .slides video::-webkit-media-controls-panel {
        width: calc(100% + 30px) !important;
        bottom: -15px !important;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-appearance: -apple-pay-button) {
    html {
        height: -webkit-fill-available;
    }
    
    body {
        min-height: -webkit-fill-available;
    }
    
    .hero-page {
        min-height: -webkit-fill-available;
    }
    
    /* Fix iOS Safari video playback */
    .slides video {
        -webkit-playsinline: true;
    }
}
