/* Optimized Styles - Bug Free and Compact */
:root {
    --page-bg: rgba(0, 0, 0, 0.6);
    --content-bg: rgba(0, 0, 0, 0.7);
    --text-color: #e8e8e8;
    --heading-color: #ffffff;
    --link-color: #64b5f6;
    --link-hover-color: #42a5f5;
    --logo-sub-color: #bdbdbd;
    --border-color: rgba(255, 255, 255, 0.15);
    --grid-item-shadow: rgba(0,0,0,0.4);
    --bg-color: var(--content-bg);
}

[data-theme="dark"] {
    --page-bg: rgba(23, 42, 69, 0.6);
    --content-bg: rgba(23, 42, 69, 0.8);
    --text-color: #c5d1de;
    --heading-color: #e1e8f0;
    --link-color: #63b3ed;
    --link-hover-color: #90cdf4;
    --logo-sub-color: #a0aec0;
    --border-color: rgba(99, 179, 237, 0.3);
    --grid-item-shadow: rgba(0,0,0,0.3);
    --bg-color: var(--content-bg);
}

html {
    background: url('images/13514659_SL.123119.26540.04.jpg') no-repeat center center fixed;
    background-size: cover;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    scroll-behavior: smooth;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: -1;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background: 
        linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('images/13514659_SL.123119.26540.04.jpg') no-repeat center center fixed;
    background-size: cover;
    font-size: 14px;
    transition: all 0.3s ease;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    flex-wrap: wrap;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.logo a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.logo a:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.logo .logo-main {
    font-size: 1.6em;
    font-weight: bold;
    color: #ffffff;
    transition: color 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.logo a:hover .logo-main {
    color: #e74c3c;
}

.logo .logo-sub {
    font-size: 0.8em;
    color: #bdbdbd;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    font-weight: 500;
}

.logo a:hover .logo-sub {
    color: #64b5f6;
    transform: translateX(5px);
}

/* Mobile Navigation */
.main-header nav {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.main-header nav.nav-active { 
    display: flex; 
    transform: translateY(0);
    opacity: 1;
}

.main-header nav a {
    padding: 12px 16px;
    text-decoration: none;
    color: #ffffff;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
    font-size: 0.95em;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.main-header nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(100, 181, 246, 0.2), transparent);
    transition: left 0.5s ease;
}

.main-header nav a:hover::before {
    left: 100%;
}

.main-header nav a:hover {
    background: rgba(100, 181, 246, 0.15);
    transform: translateX(8px);
    color: #64b5f6;
    border-color: rgba(100, 181, 246, 0.3);
    box-shadow: 0 4px 12px rgba(100, 181, 246, 0.2);
}

/* Hamburger Menu */
.menu-toggle { 
    display: block; 
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    transform: scale(1.1);
}

.menu-toggle .bar {
    display: block;
    width: 18px;
    height: 2px;
    margin: 3px 0;
    background-color: #ffffff;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.menu-toggle.active .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-3px, 4px);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: rotate(45deg) translate(-3px, -4px);
}

/* main */
main {
    padding: 12px;
    margin: 12px auto;
    max-width: 100%;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Bio Summary Section */
.bio-summary {
    padding: 30px 20px;
    margin: 20px auto;
    width: 85%;
    max-width: 1200px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    overflow: hidden;
}

.bio-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(100, 181, 246, 0.1), transparent);
    animation: shimmer 3s infinite;
}

.bio-content {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.bio-content p {
    color: #f0f0f0;
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: justify;
    margin: 0;
    font-weight: 400;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.3px;
    word-spacing: 1px;
    animation: textReveal 1s ease-out 0.3s both;
    position: relative;
}

.bio-content p:hover {
    color: #ffffff;
    transition: all 0.4s ease;
    transform: translateY(-2px);
}

/* Bio Summary Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

/* Responsive adjustments for bio-summary */
@media (max-width: 768px) {
    .bio-summary {
        width: 95%;
        padding: 25px 15px;
    }

    .bio-content p {
        font-size: 1rem;
        line-height: 1.7;
        text-align: left;
    }
    
    /* Publications page responsive */
    .book-feature {
        padding: 20px 15px;
        margin: 20px 0;
    }
    
    .book-details h2 {
        font-size: 1.2rem;
        line-height: 1.3;
    }
    
    .book-details p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .page-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .page-gallery-grid img {
        height: 150px;
    }
    
    .book-highlights {
        padding: 15px;
    }
    
    .book-highlights h4 {
        font-size: 1rem;
    }
    
    .book-highlights li {
        font-size: 0.9rem;
        padding-left: 20px;
    }
}

@media (max-width: 480px) {
    .bio-summary {
        width: 98%;
        padding: 20px 12px;
    }

    .bio-content p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    /* Publications page responsive */
    .book-feature {
        padding: 15px 12px;
        margin: 15px 0;
    }
    
    .book-details h2 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .book-details p {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 12px;
    }
    
    .page-gallery-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .page-gallery-grid img {
        height: 180px;
    }
    
    .book-highlights {
        padding: 12px;
        margin-top: 15px;
    }
    
    .book-highlights h4 {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }
    
    .book-highlights li {
        font-size: 0.85rem;
        padding: 6px 0;
        padding-left: 18px;
    }
    
    .button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Tablet and desktop improvements */
@media (min-width: 768px) {
    .book-feature {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 30px;
        align-items: start;
    }
    
    .book-cover {
        margin: 0;
        max-width: 220px;
    }
    
    .book-details {
        text-align: left;
    }
    
    .page-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .page-gallery-grid img {
        height: 220px;
    }
}

@media (min-width: 1024px) {
    .book-feature {
        gap: 40px;
    }
    
    .book-cover {
        max-width: 250px;
    }
    
    .page-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 25px;
    }
    
    .page-gallery-grid img {
        height: 250px;
    }
}

/* Grid Container */
h1, h2, h3 {
    color: var(--heading-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
    margin: 0 auto;
    font-size: 1.4em;
    transition: all 0.3s ease;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

h1 {
    font-size: 1.4em;
    margin-bottom: 15px;
}

h2 {
    font-size: 1.2em;
    margin-bottom: 12px;
}

h3 {
    font-size: 1.1em;
    margin-bottom: 10px;
}

h1:hover, h2:hover, h3:hover {
    color: #64b5f6;
    transform: translateX(5px);
}

h1::after, h2::after, h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #64b5f6, #42a5f5);
    transition: width 0.3s ease;
}

h1:hover::after, h2:hover::after, h3:hover::after {
    width: 100%;
}

/* Home Page Grid */
.grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
    max-width: 100%;
    margin: 0 auto;
}

.grid-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    text-align: center;
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-decoration: none;
    color: #ffffff;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.grid-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.6s ease;
}

.grid-item:hover::before {
    left: 100%;
}

.grid-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.3),
        0 4px 16px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(100, 181, 246, 0.3);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

.grid-item h2 {
    border: none;
    padding-bottom: 0;
    margin-bottom: 12px;
    font-size: 1.2em;
    margin-top: 16px;
    transition: all 0.3s ease;
    color: #ffffff;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.grid-item:hover h2 {
    color: #64b5f6;
    transform: scale(1.05);
}

.grid-item img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s ease;
    filter: grayscale(20%);
    background: rgba(255, 255, 255, 0.05);
    margin-left: auto;
    margin-right: auto;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(255, 255, 255, 0.1);
}

.grid-item:hover img {
    transform: scale(1.05);
    filter: grayscale(0%);
    border-color: rgba(100, 181, 246, 0.5);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(255, 255, 255, 0.15);
}

/* Content Images */
.profile-pic,
.profile-pic-about,
.organizer-logo,
.book-cover {
    float: none;
    margin: 0 auto 15px;
    border-radius: 6px;
    width: 100%;
    max-width: 250px;
    height: auto;
    object-fit: cover;
    border: 1px solid var(--border-color);
    display: block;
    transition: all 0.4s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.profile-pic:hover,
.profile-pic-about:hover,
.organizer-logo:hover,
.book-cover:hover {
    transform: scale(1.05) rotate(1deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Publications Page Styling */
.book-feature {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 25px;
    margin: 25px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        0 2px 8px rgba(255, 255, 255, 0.05);
    transition: all 0.4s ease;
    overflow: hidden;
    position: relative;
}

.book-feature::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(100, 181, 246, 0.05), transparent);
    transition: left 0.6s ease;
}

.book-feature:hover::before {
    left: 100%;
}

.book-feature:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.3),
        0 4px 16px rgba(255, 255, 255, 0.1);
    border-color: rgba(100, 181, 246, 0.3);
}

.book-cover {
    max-width: 200px;
    margin: 0 auto 20px;
    border-radius: 12px;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(255, 255, 255, 0.1);
}

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

.book-details h2 {
    color: #ffffff;
    font-size: 1.4rem;
    margin-bottom: 20px;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.book-details p {
    color: #e8e8e8;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 15px;
    text-align: left;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Malayalam Font Support */
.book-details h2:lang(ml),
.book-details p:lang(ml),
.book-highlights h4:lang(ml),
.book-highlights li:lang(ml) {
    font-family: 'Noto Sans Malayalam', 'Malayalam Sangam MN', 'Kartika', 'Arial Unicode MS', 'Segoe UI', sans-serif;
    font-weight: 500;
    line-height: 1.8;
    letter-spacing: 0.5px;
    word-spacing: 2px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure proper text rendering for all Malayalam content */
[lang="ml"] {
    font-family: 'Noto Sans Malayalam', 'Malayalam Sangam MN', 'Kartika', 'Arial Unicode MS', 'Segoe UI', sans-serif !important;
    font-weight: 500;
    line-height: 1.8;
    letter-spacing: 0.5px;
    word-spacing: 2px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fallback for systems without Malayalam fonts */
@supports not (font-family: 'Noto Sans Malayalam') {
    [lang="ml"] {
        font-family: 'Arial Unicode MS', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        font-weight: 400;
    }
}

.book-highlights {
    background: rgba(100, 181, 246, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid rgba(100, 181, 246, 0.2);
}

.book-highlights h4 {
    color: #64b5f6;
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-align: left;
    font-weight: 600;
}

.book-highlights ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.book-highlights li {
    color: #e8e8e8;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    padding-left: 25px;
}

.book-highlights li:before {
    content: '•';
    color: #64b5f6;
    font-weight: bold;
    position: absolute;
    left: 8px;
    font-size: 1.2em;
}

.book-highlights li:last-child {
    border-bottom: none;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #64b5f6, #42a5f5);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(100, 181, 246, 0.3);
    margin-top: 15px;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(100, 181, 246, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #42a5f5, #2196f3);
}

.button i {
    font-size: 1.1em;
}

/* Book Praise Section */
.book-praised {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 25px;
    margin: 25px 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.book-praised h3 {
    color: #64b5f6;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

blockquote {
    background: rgba(100, 181, 246, 0.05);
    border-left: 4px solid #64b5f6;
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    position: relative;
}

blockquote p {
    color: #e8e8e8;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.7;
    margin: 0 0 15px 0;
    font-family: 'Georgia', 'Times New Roman', serif;
}

blockquote footer {
    color: #64b5f6;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: right;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Page Gallery Section */
.page-gallery {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 25px;
    margin: 25px 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.page-gallery h3 {
    color: #64b5f6;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.page-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.page-gallery-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    transition: all 0.4s ease;
    cursor: pointer;
    opacity: 0.9;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 2px 8px rgba(255, 255, 255, 0.05);
}

.page-gallery-grid img:hover {
    transform: scale(1.05);
    opacity: 1;
    border-color: rgba(100, 181, 246, 0.4);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(100, 181, 246, 0.2);
}

/* Gallery */
.gallery-intro {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.1em;
    line-height: 1.6;
    color: var(--text-color);
}

.gallery-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    padding: 0 8px;
}

.gallery-filter {
    background: var(--content-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9em;
    min-width: 70px;
    text-align: center;
    min-height: 36px;
}

.gallery-filter:hover {
    background: var(--link-color);
    color: #000;
    transform: translateY(-2px);
}

.gallery-filter.active {
    background: var(--link-color);
    color: #000;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.professional-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 30px;
    padding: 12px;
}

.professional-gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    transition: all 0.4s ease;
    cursor: pointer;
    filter: brightness(0.9);
}

.professional-gallery img:hover {
    transform: scale(1.05) rotate(2deg);
    filter: brightness(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.page-gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
}

.page-gallery-grid img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    transition: all 0.4s ease;
    cursor: pointer;
    opacity: 0.8;
}

.page-gallery-grid img:hover {
    transform: scale(1.08);
    opacity: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Make all images clickable */
img {
    cursor: pointer;
    transition: all 0.3s ease;
}

img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Specific image types */
.profile-pic,
.profile-pic-about,
.book-cover,
.organizer-logo {
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-pic:hover,
.profile-pic-about:hover,
.book-cover:hover,
.organizer-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Grid item images */
.grid-item img {
    cursor: pointer;
    transition: all 0.3s ease;
}

.grid-item img:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

/* Contact Form */
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9em;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    min-height: 36px;
}

input:focus, textarea:focus, select:focus {
    border-color: #64b5f6;
    box-shadow: 0 0 12px rgba(100, 181, 246, 0.4);
    transform: scale(1.02);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 16px;
    margin-top: 30px;
    color: #ffffff;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

footer p {
    transition: all 0.3s ease;
    margin-bottom: 12px;
    font-size: 0.9em;
    color: #e8e8e8;
}

.social-links {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    min-width: 40px;
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #64b5f6, #42a5f5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.social-links a:hover::before {
    opacity: 1;
}

.social-links a:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 20px rgba(100, 181, 246, 0.3);
    border-color: rgba(100, 181, 246, 0.5);
}

.social-links a i {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    font-size: 1em;
}

.social-links a:hover i {
    transform: rotate(360deg);
}

footer a {
    color: #64b5f6;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 500;
}

footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #64b5f6;
    transition: width 0.3s ease;
}

footer a:hover::after {
    width: 100%;
}

footer a:hover {
    color: #ffffff;
}

/* Tablet Styles */
@media (min-width: 768px) {
    body {
        font-size: 16px;
    }
    
    .main-header {
        padding: 15px 25px;
    }
    
    .logo .logo-main {
        font-size: 2em;
    }
    
    .logo .logo-sub {
        font-size: 0.9em;
    }
    
    main {
        padding: 20px;
        margin: 15px auto;
        max-width: 800px;
    }
    
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }
    
    .grid-item {
        padding: 20px;
    }
    
    .grid-item h2 {
        font-size: 1.3em;
    }
    
    .profile-pic,
    .profile-pic-about,
    .organizer-logo {
        max-width: 200px;
    }
    
    .professional-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }
    
    .page-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .gallery-nav {
        gap: 12px;
    }
    
    .gallery-filter {
        padding: 10px 16px;
        font-size: 1em;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .main-header {
        padding: 15px 40px;
    }
    
    .logo .logo-main {
        font-size: 2.2em;
    }
    
    .logo .logo-sub {
        font-size: 1em;
    }
    
    main {
        padding: 25px;
        margin: 15px auto;
        max-width: 900px;
    }
    
    .grid-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        padding: 20px;
        max-width: 1200px;
    }
    
    .grid-item {
        padding: 25px;
    }
    
    .grid-item h2 {
        font-size: 1.4em;
    }
    
    .profile-pic {
        float: right;
        margin: 0 0 15px 15px;
        width: 200px;
        max-width: 200px;
    }
    
    .profile-pic-about,
    .organizer-logo {
        float: left;
        margin-right: 20px;
        margin-bottom: 10px;
        max-width: 200px;
    }
    
    .professional-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 20px;
    }
    
    .page-gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    
    .gallery-nav {
        gap: 15px;
    }
    
    .gallery-filter {
        padding: 12px 20px;
        font-size: 1em;
    }
    
    /* Show desktop navigation */
    .main-header nav {
        display: flex;
        flex-direction: row;
        position: static;
        width: auto;
        background: transparent;
        border: none;
        transform: none;
        opacity: 1;
    }
    
    .main-header nav a {
        margin: 0 12px;
        padding: 8px;
        border: none;
        text-align: left;
    }
    
    /* Hide hamburger menu on desktop */
    .menu-toggle {
        display: none;
    }
}

/* Large Desktop Styles */
@media (min-width: 1200px) {
    .grid-container {
        max-width: 1400px;
        gap: 25px;
        padding: 25px;
    }
    
    .grid-item {
        padding: 30px;
    }
    
    .grid-item h2 {
        font-size: 1.5em;
    }
    
    main {
        max-width: 1000px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .grid-item:hover {
        transform: none;
    }
    
    .gallery-item:hover {
        transform: none;
    }
    
    .gallery-item:hover img {
        transform: none;
    }
    
    .gallery-overlay {
        transform: translateY(0);
        background: linear-gradient(transparent, rgba(0,0,0,0.9));
    }
    
    .gallery-filter:hover {
        transform: none;
    }
}

/* Mobile-specific improvements */
@media (max-width: 767px) {
    body {
        font-size: 15px;
        line-height: 1.6;
    }

    h1 {
        font-size: 1.4em;
        margin-bottom: 12px;
    }

    h2 {
        font-size: 1.3em;
        margin-bottom: 12px;
    }

    h3 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }

    main {
        padding: 8px;
        margin: 8px;
    }

    .grid-container {
        padding: 8px;
        gap: 8px;
    }

    .grid-item {
        padding: 12px;
        min-height: 120px;
    }

    .profile-pic,
    .profile-pic-about,
    .organizer-logo {
        max-width: 100%;
        margin-bottom: 12px;
    }

    .page-gallery-grid {
        gap: 8px;
        padding: 0 4px;
    }

    .professional-gallery {
        gap: 12px;
        padding: 0 4px;
    }

    .main-header {
        padding: 8px 12px;
    }

    .logo .logo-main {
        font-size: 1.6em;
    }

    .logo .logo-sub {
        font-size: 0.7em;
    }

    .contact-form input,
    .contact-form textarea {
        padding: 12px;
        margin-bottom: 12px;
        font-size: 16px;
    }

    footer {
        padding: 12px;
        margin-top: 15px;
    }

    .social-links {
        margin-top: 12px;
        padding-top: 12px;
    }

    .social-links a {
        margin: 0 6px;
        font-size: 1.2em;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .main-header {
        padding: 6px 10px;
    }

    .logo .logo-main {
        font-size: 1.4em;
    }

    .logo .logo-sub {
        font-size: 0.6em;
    }

    main {
        padding: 10px;
        margin: 6px;
    }

    .grid-container {
        padding: 10px;
        gap: 10px;
    }

    .grid-item {
        padding: 10px;
        min-height: 110px;
    }

    .grid-item h2 {
        font-size: 1.1em;
    }

    h1 {
        font-size: 1.3em;
    }

    h2 {
        font-size: 1.2em;
    }

    h3 {
        font-size: 1em;
    }

    .page-gallery-grid {
        gap: 6px;
        padding: 0 2px;
    }

    .professional-gallery {
        gap: 10px;
        padding: 0 2px;
    }

    .gallery-nav {
        gap: 6px;
        margin-bottom: 15px;
    }

    .gallery-filter {
        padding: 6px 10px;
        font-size: 0.8em;
        min-width: 60px;
    }
}

/* Landscape mobile orientation */
@media (max-width: 767px) and (orientation: landscape) {
    .main-header {
        padding: 6px 15px;
    }

    .logo .logo-main {
        font-size: 1.6em;
    }

    .logo .logo-sub {
        font-size: 0.7em;
    }

    main {
        padding: 15px;
        margin: 10px;
    }

    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .grid-item img,
    .profile-pic,
    .profile-pic-about,
    .organizer-logo,
    .book-cover,
    .gallery-item img,
    .page-gallery-grid img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .main-header,
    .menu-toggle,
    .social-links {
        display: none;
    }
    
    main {
        background: white;
        box-shadow: none;
        margin: 0;
        padding: 15px;
    }
    
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth entrance animations */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.slide-in-up {
    animation: slideInUp 0.6s ease-out;
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

/* Staggered animations */
.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* Pulse animation */
.pulse {
    animation: pulse 2s infinite;
}

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

/* Bounce animation */
.bounce {
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-10px);
    }
    70% {
        transform: translateY(-5px);
    }
    90% {
        transform: translateY(-2px);
    }
}

/* Button animations */
button, .btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    padding: 6px 12px;
    font-size: 0.9em;
    min-height: 36px;
    min-width: 80px;
}

button::before, .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

button:hover::before, .btn:hover::before {
    width: 300px;
    height: 300px;
}

button:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* List item animations */
ul li {
    transition: all 0.3s ease;
    padding: 2px 0;
    margin-bottom: 4px;
    font-size: 0.9em;
}

ul li:hover {
    transform: translateX(5px);
    color: #64b5f6;
}

/* Link animations */
a {
    transition: all 0.3s ease;
}

a:hover {
    color: #64b5f6;
}

/* Image loading animations */
img {
    opacity: 0;
    animation: fadeInImage 0.6s ease-out forwards;
}

@keyframes fadeInImage {
    to {
        opacity: 1;
    }
}

/* Page transitions */
.page-transition {
    animation: pageSlide 0.5s ease-out;
}

@keyframes pageSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Hover effects for interactive elements */
.interactive-element {
    transition: all 0.3s ease;
}

.interactive-element:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Fix for image aspect ratio issues */
img {
    max-width: 100%;
    height: auto;
}

/* Fix for text overflow issues */
.grid-item h2,
.grid-item p,
h1, h2, h3 {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Fix for mobile touch targets */
@media (max-width: 767px) {
    .main-header nav a,
    .grid-item,
    .social-links a,
    button, .btn {
        min-height: 36px;
    }
}

/* Image Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.show {
    opacity: 1;
}

.image-modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: zoom-in;
    transform-origin: center center;
}

.modal-image.maximized {
    cursor: zoom-out;
    transform: scale(1.5);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

/* Add smooth transition for maximize/minimize */
.modal-image {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add loading animation */
.modal-image.loading {
    opacity: 0.7;
    filter: blur(1px);
}

/* Improve button animations */
.modal-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.modal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.modal-btn:hover::before {
    left: 100%;
}

.modal-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.modal-btn:active {
    transform: scale(0.95);
}

.modal-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10001;
}

.modal-close {
    background: rgba(255, 0, 0, 0.3);
    border: 1px solid rgba(255, 0, 0, 0.5);
}

.modal-close:hover {
    background: rgba(255, 0, 0, 0.5);
}

.modal-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-info h3 {
    margin: 0 0 8px 0;
    color: #ffffff;
    font-size: 1.1em;
}

.modal-info p {
    margin: 0;
    color: #e8e8e8;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Mobile optimizations for modal */
@media (max-width: 768px) {
    .image-modal-content {
        padding: 10px;
        width: 95%;
        height: 95%;
    }
    
    .modal-controls {
        top: 10px;
        right: 10px;
        flex-direction: column;
    }
    
    .modal-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .modal-info {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 12px;
    }
    
    .modal-info h3 {
        font-size: 1em;
    }
    
    .modal-info p {
        font-size: 0.8em;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .modal-image {
        cursor: default;
    }
    
    .modal-image.maximized {
        cursor: default;
    }
    
    /* Add touch-friendly button sizes */
    .modal-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
    }
    
    /* Improve touch targets */
    .modal-controls {
        gap: 15px;
    }
}

/* Ensure modal works on all screen sizes */
@media (max-width: 480px) {
    .image-modal-content {
        padding: 5px;
        width: 98%;
        height: 98%;
    }
    
    .modal-controls {
        top: 5px;
        right: 5px;
    }
    
    .modal-info {
        bottom: 5px;
        left: 5px;
        right: 5px;
        padding: 10px;
    }
    
    .modal-image.maximized {
        transform: scale(1.2);
    }
}

/* High DPI display support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .modal-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}
