/* gallery.css - Gallery Page Styles for Pangani Girls' High School */

/* Import base styles from home.css */
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #1a4c8c;
    --secondary-blue: #2c6cb0;
    --accent-red: #e74c3c;
    --light-blue: #e8f1ff;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #343a40;
    --text-color: #333333;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--white);
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.3;
}

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Button Styles */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    border: none;
}

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

.btn-primary:hover {
    background-color: #c0392b;
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
    background-color: var(--primary-blue);
    color: var(--white);
    transform: translateY(-3px);
}

/* Header Styles */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-container {
    flex: 0 0 100px;
}

.logo {
    max-width: 100%;
    height: auto;
    max-height: 80px;
}

/* Navigation Styles */
.nav-menu {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
}

.nav-item {
    margin-left: 25px;
    position: relative;
}

.nav-item a {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    color: var(--dark-gray);
    padding: 8px 0;
    position: relative;
}

.nav-item a:hover {
    color: var(--primary-blue);
}

.nav-item.active a {
    color: var(--primary-blue);
}

.nav-item.active a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-blue);
    border-radius: 2px;
}

.admin-btn a {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 8px 15px;
    border-radius: 4px;
}

.admin-btn a:hover {
    background-color: var(--secondary-blue);
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--primary-blue);
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 90vh;
    min-height: 400px;
    background-image: url('../assets/gallery-hero.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    margin-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 76, 140, 0.5);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 30px;
    font-weight: 300;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: var(--white);
    font-size: 1.5rem;
    animation: bounce 2s infinite;
    cursor: pointer;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Section Styles */
.section-title {
    font-size: 2.5rem;
    color: var(--primary-blue);
    text-align: center;
    margin-bottom: 15px;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--dark-gray);
    max-width: 700px;
    margin: 0 auto 50px;
}

.section-header {
    margin-bottom: 40px;
}

/* Gallery Filter */
.gallery-filter {
    padding: 40px 0;
    background-color: var(--light-gray);
}

.filter-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.filter-btn {
    padding: 8px 20px;
    background-color: var(--white);
    border: 1px solid var(--medium-gray);
    border-radius: 30px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: var(--dark-gray);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background-color: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

.filter-btn.active {
    background-color: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

/* Photo Gallery */
.photo-gallery {
    padding: 80px 0;
    background-color: var(--white);
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.photo-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    height: 250px;
    cursor: pointer;
    transition: var(--transition);
}

.photo-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

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

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 76, 140, 0.85);
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: var(--transition);
    padding: 20px;
    z-index: 2;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.photo-info {
    color: var(--white);
    transform: translateY(20px);
    transition: var(--transition);
}

.photo-item:hover .photo-info {
    transform: translateY(0);
}

.photo-title {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--white);
}

.photo-description {
    font-size: 0.9rem;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
}

.photo-actions {
    display: flex;
    gap: 10px;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--accent-red);
    color: var(--white);
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 3;
    position: relative;
}

.view-btn:hover {
    background-color: #c0392b;
    transform: translateY(-3px);
}

/* Video Gallery Specific Styles */
.video-gallery {
    padding: 80px 0;
    background-color: var(--light-gray);
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.video-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    height: 220px;
    cursor: pointer;
    transition: var(--transition);
}

.video-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    position: relative;
    z-index: 1;
}

/* Video autoplay element */
.video-thumbnail video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    border-radius: 8px;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(231, 76, 60, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    transition: var(--transition);
    z-index: 2;
    pointer-events: none;
}

.video-item:hover .play-icon {
    background-color: var(--accent-red);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Video Overlay - Always visible on hover */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 76, 140, 0.85);
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    z-index: 3; /* Above video, below buttons */
    pointer-events: none; /* Allow clicks to pass through to video */
}

.video-item:hover .video-overlay {
    opacity: 1;
    pointer-events: auto; /* Enable clicks on overlay */
}

.video-info {
    color: var(--white);
    transform: translateY(20px);
    transition: var(--transition);
    pointer-events: none; /* Text not clickable */
}

.video-item:hover .video-info {
    transform: translateY(0);
}

.video-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--white);
    pointer-events: none;
}

.video-description {
    font-size: 0.85rem;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
    pointer-events: none;
}

.video-actions {
    display: flex;
    gap: 10px;
    pointer-events: auto; /* Buttons are clickable */
}

/* Special styling for local video overlay */
.video-overlay .view-btn {
    pointer-events: auto;
    z-index: 4;
    position: relative;
}

/* Local video indicator */
.local-video::after {
    content: ' (Local)';
    font-size: 0.8em;
    opacity: 0.5;
}

.load-more-container {
    text-align: center;
    margin-top: 40px;
}

.load-more-btn {
    padding: 12px 40px;
}

/* Featured Gallery */
.featured-gallery {
    padding: 80px 0;
    background-color: var(--white);
}

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

.featured-item {
    background-color: var(--light-gray);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.featured-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.featured-media {
    height: 200px;
    overflow: hidden;
}

.featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.featured-content {
    padding: 20px;
}

.featured-title {
    font-size: 1.2rem;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.featured-description {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 15px;
}

.featured-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--dark-gray);
}

.featured-date i {
    color: var(--accent-red);
}

/* Footer */
.footer {
    background-color: var(--dark-gray);
    color: var(--white);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo img {
    max-width: 180px;
    margin-bottom: 15px;
}

.footer-motto {
    font-style: italic;
    margin-bottom: 20px;
    color: #ccc;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-blue);
    transform: translateY(-5px);
}

.footer-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--white);
    position: relative;
    padding-bottom: 10px;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--accent-red);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ccc;
}

.footer-links a:hover {
    color: var(--white);
    padding-left: 5px;
}

.contact-info {
    list-style: none;
}

.contact-info li {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.contact-info i {
    margin-right: 10px;
    color: var(--accent-red);
    margin-top: 3px;
}

.vision-text, .mission-text {
    font-size: 0.95rem;
    color: #ccc;
    line-height: 1.5;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.animate-fade-up {
    animation: fadeUp 1s ease-out;
}

.animate-fade-up-delay {
    animation: fadeUp 1s ease-out 0.3s both;
}

.animate-fade-up-delay-2 {
    animation: fadeUp 1s ease-out 0.6s both;
}

/* Video Lightbox Styles */
.video-lightbox-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.95) !important;
    z-index: 2000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
}

.video-lightbox-overlay video {
    object-fit: contain !important;
    max-width: 100% !important;
    max-height: 100% !important;
    background-color: #000 !important;
    display: block !important;
}

/* Ensure video elements maintain aspect ratio */
.video-lightbox-overlay video {
    object-fit: contain !important;
    max-width: 100% !important;
    max-height: 100% !important;
    background-color: #000;
}

/* Video lightbox close button */
.video-lightbox-overlay button {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 2001;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.video-lightbox-overlay button:hover {
    opacity: 1;
}

/* Video lightbox container */
.video-lightbox-overlay > div {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #000;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Video wrapper for proper centering */
.video-lightbox-overlay > div > div:first-of-type {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 1;
}

/* Video title styling */
.video-lightbox-overlay > div > div:last-of-type {
    color: white;
    margin-top: 20px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    max-width: 100%;
    padding: 0 10px;
}

/* Custom Video Overlay Styles for Hover Functionality */
.video-item .video-overlay {
    opacity: 0;
    transition: opacity 0.3s ease !important;
    pointer-events: none;
}

.video-item:hover .video-overlay {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.video-item .view-btn {
    z-index: 4 !important;
    position: relative;
}

.video-item .play-icon {
    z-index: 3 !important;
}

.video-item video {
    z-index: 1 !important;
}

.video-item .video-img {
    z-index: 2 !important;
}

/* Make sure autoplay video doesn't interfere with overlay */
.video-thumbnail {
    position: relative;
}

.video-thumbnail video {
    pointer-events: none; /* Video doesn't capture mouse events */
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .photos-grid,
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .featured-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .nav-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    }
    
    .nav-list.active {
        display: flex;
    }
    
    .nav-item {
        margin: 10px 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .hero {
        height: 50vh;
        min-height: 300px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .filter-controls {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 6px 15px;
        font-size: 0.9rem;
    }
    
    .photos-grid,
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Video lightbox adjustments for mobile */
    .video-lightbox-overlay {
        padding: 10px !important;
    }
    
    .video-lightbox-overlay > div {
        width: 95% !important;
        padding: 15px !important;
    }
    
    .video-lightbox-overlay button {
        top: -35px !important;
        font-size: 1.5rem !important;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .photos-grid,
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .photo-item,
    .video-item {
        height: 200px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    /* Hide local indicator on very small screens */
    .local-video::after {
        display: none;
    }
    
    /* Video lightbox adjustments for very small screens */
    .video-lightbox-overlay > div {
        width: 98% !important;
        padding: 10px !important;
        max-height: 70vh !important;
    }
    
    .video-lightbox-overlay button {
        top: -30px !important;
        font-size: 1.3rem !important;
    }
    
    .video-lightbox-overlay > div > div:last-of-type {
        font-size: 0.9rem !important;
        margin-top: 15px !important;
    }
}

/* Loading animation for page */
body.loaded .hero-content {
    animation: fadeUp 1s ease-out;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-blue);
}