/* Base Theme System - Uses CSS Custom Properties */

/* Base styles from original */
body {
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: var(--main-bg);
    color: var(--main-text);
}

/* Smaller headings */
h1 { font-size: 1.5rem; font-weight: 500; color: var(--main-text); }
h2 { font-size: 1.25rem; font-weight: 500; color: var(--main-text); }
h3 { font-size: 1.125rem; font-weight: 500; color: var(--main-text); }
h4 { font-size: 1rem; font-weight: 500; color: var(--main-text); }
h5 { font-size: 0.875rem; font-weight: 600; color: var(--main-text); }
h6 { font-size: 0.875rem; font-weight: 600; color: var(--main-text); }

/* Conversation Title Styling - Make titles more prominent across all pages */
.conversation-item .card-body h6,
a.conversation-item h6,
.conversation-list .card-body .flex-grow-1 h6,
.conversation-detail h1,
.conversation-detail h2,
.conversation-info h4,
.main-header h1,
a[href*="conversation"] .card-body .flex-grow-1 h6 {
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    color: var(--primary-color) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
    letter-spacing: 0.3px !important;
    line-height: 1.3 !important;
}

/* Sidebar Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styles */
.app-sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--sidebar-border);
    background-color: var(--sidebar-header-bg);
}

.sidebar-brand {
    color: var(--sidebar-header-text, var(--sidebar-text));
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
}

.sidebar-brand:hover {
    color: var(--sidebar-header-text, var(--sidebar-text));
    text-decoration: none;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section-title {
    color: var(--sidebar-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 1rem;
    margin-bottom: 0.5rem;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-item {
    margin: 0;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--sidebar-text-muted);
    text-decoration: none;
    border-radius: 0.25rem;
    margin: 0 0.5rem;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-nav-link:hover {
    background-color: var(--sidebar-hover-bg);
    color: var(--sidebar-text);
    text-decoration: none;
}

.sidebar-nav-link.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-text);
}

.sidebar-nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
}

/* User info in sidebar */
.sidebar-user {
    padding: 1rem;
    border-top: 1px solid var(--sidebar-border);
    background-color: var(--sidebar-header-bg);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    color: var(--sidebar-text-muted);
    font-size: 0.875rem;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--sidebar-hover-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--sidebar-text);
}

/* Main Content */
.app-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background-color: var(--main-bg);
}

.main-header {
    background-color: var(--main-header-bg);
    border-bottom: 1px solid var(--main-header-border);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--card-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--main-text);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    background-color: var(--main-content-bg);
}

/* Messages */
.messages-container {
    position: sticky;
    top: 0;
    z-index: 90;
    margin-bottom: 0;
}

.messages-container .alert {
    margin-bottom: 0;
    border-radius: 0;
}

/* Cards and Components */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 0.375rem;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s ease;
    overflow: hidden;  /* Prevent images from breaking out */
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

/* Form Elements */
.form-control, .form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--main-text);
    border-radius: 0.375rem;
}

.form-control:focus, .form-select:focus {
    background-color: var(--input-bg);
    border-color: var(--input-focus-border);
    box-shadow: var(--input-focus-shadow);
    color: var(--main-text);
}

/* Buttons */
.btn-primary {
    background-color: var(--btn-primary-bg);
    border-color: var(--btn-primary-border);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--btn-primary-hover-bg);
    border-color: var(--btn-primary-hover-bg);
    color: #ffffff;
}

.btn-secondary {
    background-color: var(--btn-secondary-bg);
    border-color: var(--btn-secondary-border);
    color: #ffffff;
}

/* File Upload Button - Uses theme colors */
.file-input-label-compact {
    display: inline-block;
    padding: 10px 20px;
    background: #667eea;  /* Fallback color */
    background: var(--primary-color, #667eea);
    background: linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--primary-hover, #764ba2) 100%);
    color: white !important;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 500;
    font-size: 14px;
    border: none;
    text-decoration: none;
}

.file-input-label-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--card-shadow-hover);
    color: white;
    text-decoration: none;
}

/* Gallery Preview for file uploads */
.gallery-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.gallery-preview .preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
}

.gallery-preview img,
.gallery-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Alerts */
.alert-primary { 
    background-color: var(--primary-color) !important; 
    border-color: var(--primary-color) !important; 
    color: #ffffff !important;
}
.alert-success { 
    background-color: var(--success-color) !important; 
    border-color: var(--success-color) !important; 
    color: #ffffff !important;
}
.alert-warning { 
    background-color: var(--warning-color) !important; 
    border-color: var(--warning-color) !important; 
    color: #212529 !important;
}
.alert-danger { 
    background-color: var(--danger-color) !important; 
    border-color: var(--danger-color) !important; 
    color: #ffffff !important;
}
.alert-info { 
    background-color: var(--info-color) !important; 
    border-color: var(--info-color) !important; 
    color: #ffffff !important;
}

/* Mobile and Tablet Styles */
@media (max-width: 1199px) {
    .app-sidebar {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        height: 100vh !important;
        z-index: 9999 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease !important;
    }
    
    .app-sidebar.show {
        transform: translateX(0) !important;
    }
    
    .app-main {
        margin-left: 0 !important;
        padding: 1rem;
        width: 100% !important;
    }
    
    .mobile-menu-toggle {
        display: block !important;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 9998;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Adjust container widths for better readability */
    .container, .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Stack cards on smaller screens */
    .row > [class*='col-'] {
        margin-bottom: 1rem;
    }
    
    /* Adjust form layouts */
    .form-label {
        font-size: 0.9rem;
    }
    
    /* Improve card spacing */
    .card {
        margin-bottom: 1rem;
    }
}

/* Mobile menu toggle button - show when sidebar should be hidden */
.mobile-menu-toggle {
    display: none;
    background: var(--primary-color, #007bff);
    border: 2px solid var(--primary-color, #007bff);
    font-size: 1.5rem;
    color: #ffffff;
    cursor: pointer;
    padding: 0.75rem;
    margin-right: 0.5rem;
    outline: none;
    min-width: 44px;
    min-height: 44px;
    border-radius: 4px;
}

.mobile-menu-toggle:hover {
    background-color: rgba(0,0,0,0.1);
}

.mobile-menu-toggle:focus {
    background-color: rgba(0,0,0,0.1) !important;
    outline: 2px solid var(--primary-color, #007bff) !important;
}

/* Show mobile menu toggle when sidebar is hidden (at breakpoint 1199px and below) */
@media (max-width: 1199px) {
    .mobile-menu-toggle {
        display: block !important;
    }
}

/* Hide mobile menu toggle when sidebar is visible (1200px and above) */
@media (min-width: 1200px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}


/* Additional Component Styles */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}

/* Text Colors */
.text-muted {
    color: var(--main-text-muted) !important;
}

/* Links */
a {
    color: var(--primary-color);
}

a:hover {
    color: var(--primary-hover);
}

/* Navigation Pills/Tabs */
.nav-pills .nav-link.active {
    background-color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Theme-specific overrides for light sidebar theme */
.theme-github-light .sidebar-header {
    background-color: var(--sidebar-header-bg);
}

.theme-github-light .sidebar-brand {
    color: var(--sidebar-header-text);
}

.theme-github-light .sidebar-nav-link {
    color: var(--sidebar-text);
}

.theme-github-light .sidebar-section-title {
    color: var(--sidebar-text-muted);
}

/* Sidebar User Button Styles */
.sidebar-user .btn:hover {
    background-color: var(--sidebar-hover-bg);
    border-color: var(--sidebar-text);
}

/* ============================================
   Post Feed Card Improvements
   ============================================ */

/* Post Card Hover Effects */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Post Action Button Hover Effects */
.like-btn, .comment-toggle {
    transition: all 0.2s ease;
}

.like-btn:hover, .comment-toggle:hover {
    background-color: var(--hover-bg, #f0f0f0) !important;
    transform: scale(1.05);
}

.like-btn:active, .comment-toggle:active {
    transform: scale(0.95);
}

/* Smooth Comment Section Transitions */
.comments-section {
    transition: all 0.3s ease;
}

/* Avatar Gradient Background */
.bg-gradient {
    transition: transform 0.2s;
}

.bg-gradient:hover {
    transform: scale(1.1);
}

/* Dropdown Button Enhancement */
.dropdown button.btn-light:hover {
    background-color: var(--dropdown-hover, #e9ecef) !important;
}

/* Comment Item Hover Effect */
.comment-item {
    transition: all 0.2s ease;
}

.comment-item:hover .bg-light {
    background-color: var(--comment-hover, #e9ecef) !important;
}

/* Comment Input Focus Effect */
.comment-form input:focus {
    border-color: var(--primary-color, #667eea) !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
}

/* Post Card Container */
.post-card {
    width: 100%;
    overflow: hidden;
}

.post-card .card-body {
    padding: 1rem;
}

/* Post Media Styling - Override Bootstrap classes */
.post-media {
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    margin: 15px -1rem;  /* Negative margin to extend to card edges */
    padding: 0;
    background: #f8f9fa;
    max-height: 300px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-media img,
.post-media video {
    width: auto !important;
    height: auto !important;
    max-height: 280px !important;  /* Slightly less than container */
    max-width: 100% !important;
    object-fit: contain !important; /* Maintain aspect ratio, show full image */
    display: block !important;
    margin: 0 auto !important;
    cursor: pointer;  /* Show clickable cursor */
    transition: opacity 0.2s ease;
    pointer-events: auto !important;  /* Ensure clicks are not blocked */
    position: relative;
    z-index: 1;
}

.post-media img:hover {
    opacity: 0.9;
}

/* Override Bootstrap's img-fluid */
.post-media .img-fluid {
    max-width: 100% !important;
    max-height: 280px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

/* For very large images, ensure they scale down */
.post-media img[src] {
    max-height: 280px !important;
}

/* Video specific sizing */
.post-media video {
    width: 100% !important;
    max-height: 280px !important;
    height: auto !important;
}

/* For images in post content */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

/* Post Gallery Grid Styles */
.post-gallery {
    display: grid;
    gap: 4px;
    padding: 0 !important;
    margin: 15px 0;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

/* Gallery layouts based on image count */
.post-gallery.gallery-1 { 
    grid-template-columns: 1fr;
}
.post-gallery.gallery-1 .gallery-image {
    height: 300px;
}

.post-gallery.gallery-2 { 
    grid-template-columns: repeat(2, 1fr);
}
.post-gallery.gallery-2 .gallery-image {
    height: 200px;
}

.post-gallery.gallery-3,
.post-gallery.gallery-4 { 
    grid-template-columns: repeat(2, 1fr);
}
.post-gallery.gallery-3 .gallery-image,
.post-gallery.gallery-4 .gallery-image {
    height: 180px;
}

.post-gallery.gallery-5,
.post-gallery.gallery-6 { 
    grid-template-columns: repeat(3, 1fr);
}
.post-gallery.gallery-5 .gallery-image,
.post-gallery.gallery-6 .gallery-image {
    height: 150px;
}

.gallery-image {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    cursor: pointer;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-image:hover img {
    transform: scale(1.05);
}

/* ============================================
   Family Photos Page Styles
   ============================================ */

/* Member Panel Styles */
.member-panel {
    background: var(--card-bg, #fff);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
}

.member-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--card-border, #f0f0f0);
}

.member-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--primary-hover, #764ba2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.member-details h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--main-text, #333);
}

.member-stats {
    color: var(--main-text-muted, #666);
    font-size: 0.9rem;
}

.photo-count {
    background: var(--input-bg, #f0f0f0);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--main-text-muted, #666);
}

/* Photo Grid within each panel */
.member-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

@media (max-width: 768px) {
    .member-photos {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
}

@media (min-width: 1200px) {
    .member-photos {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }
}

/* Photo Item Styles */
.photo-item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 8px;
    background: var(--input-bg, #f5f5f5);
    aspect-ratio: 1; /* Square thumbnails */
    cursor: pointer;
    transition: transform 0.2s;
}

.photo-item:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.photo-item img,
.photo-item video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crop to fill square, maintaining aspect ratio */
}

/* Video indicator */
.video-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.video-indicator::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 16px solid white;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    margin-left: 3px;
}

/* Photo metadata overlay */
.photo-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    padding: 8px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}

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

/* Delete button */
.delete-photo-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--danger-color, #dc3545);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    font-weight: bold;
    color: var(--danger-color, #dc3545);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.photo-item:hover .delete-photo-btn {
    opacity: 1;
}

.delete-photo-btn:hover {
    background: var(--danger-color, #dc3545);
    color: white;
    transform: scale(1.1);
}

/* Upload Section */
.upload-section {
    background: var(--main-content-bg, #f8f9fa);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.upload-header h2 {
    margin: 0 0 10px 0;
    color: var(--main-text);
}

/* Swiper Lightbox Navigation - Photos page specific */
.family-photos-page .swiper-button-next::after {
    content: '>' !important;
    font-size: 20px;
    font-weight: bold;
}

.family-photos-page .swiper-button-prev::after {
    content: '<' !important;
    font-size: 20px;
    font-weight: bold;
}

/* Empty state styles */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--main-text-muted);
}

.empty-state i {
    font-size: 64px;
    color: var(--card-border);
    margin-bottom: 20px;
}

.empty-state-icon {
    font-size: 72px;
    color: var(--main-text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--main-text);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--main-text-muted);
}

/* Upload section styles that were missing */
.upload-header h2 {
    margin-bottom: 10px;
    color: var(--main-text);
}

.upload-stats {
    color: var(--main-text-muted);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* File input styling */
.file-input-wrapper {
    margin: 20px 0;
}

.file-input-label {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color, #667eea);
    background: linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--primary-hover, #764ba2) 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 500;
}

.file-input-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.file-input-label i {
    margin-right: 8px;
}

/* File preview */
.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--card-border);
}

.preview-item img,
.preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Photo Gallery Grid Styles */
.photo-grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f0f0f0;
    aspect-ratio: 1;  /* Square thumbnails */
}

.photo-grid-item img,
.photo-grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Gallery Modal Styles */
.gallery-modal .modal-dialog {
    max-width: 90vw;
    margin: 2rem auto;
}

.gallery-modal .modal-content {
    background: rgba(0,0,0,0.9);
    border: none;
}

.gallery-modal .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal .swiper-slide img,
.gallery-modal .swiper-slide video {
    max-width: 100%;
    max-height: 80vh;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 0 auto;
    display: block;
}

/* Simple Image Lightbox */
.image-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.image-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.lightbox-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 40px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10000;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 4px;
    max-width: 80%;
    text-align: center;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 48px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10000;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #dc3545;
}

/* Gallery Modal */
#galleryModal .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.9);
}

#galleryModal .modal-dialog {
    max-width: calc(100% - 100px);
    margin: 50px auto;
    height: calc(100vh - 100px);
}

#galleryModal .modal-content {
    background: transparent !important;
    border: none;
    height: 100%;
    position: relative;
}

#galleryModal .modal-body {
    padding: 0;
    height: 100%;
    position: relative;
}

#galleryModal .modal-header {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1055;
    border: none;
    background: transparent;
    padding: 0;
}

#galleryModal .btn-close {
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    opacity: 1;
    padding: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#galleryModal .btn-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

#galleryModal .btn-close::before {
    content: '×';
    color: white;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
}

#galleryModal .btn-close-white {
    filter: none;
}

/* Swiper customization */
#gallerySwiper {
    width: 100%;
    height: 100%;
}

#gallerySwiper .swiper-wrapper {
    align-items: center;
    height: 100%;
}

#gallerySwiper .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

#gallerySwiper .swiper-slide img,
#gallerySwiper .swiper-slide video {
    max-width: 90% !important;
    max-height: 85% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important; /* This preserves aspect ratio */
    display: block !important;
    margin: 0 auto !important;
}

/* Swiper navigation - premium style matching site design */
.swiper-button-next,
.swiper-button-prev {
    width: 64px;
    height: 64px;
    background: var(--primary-color, #667eea);
    background: linear-gradient(135deg, var(--primary-color, #667eea) 0%, var(--primary-hover, #764ba2) 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    z-index: 10;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.swiper-button-next {
    right: 80px;
}

.swiper-button-prev {
    left: 80px;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    transform: scale(1.1);
    opacity: 1;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Hide the default swiper arrows text */
.swiper-button-next::after,
.swiper-button-prev::after {
    display: none;
}

/* Add elegant arrow indicators */
.swiper-button-next::before,
.swiper-button-prev::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    border-top: 3px solid white;
    border-right: 3px solid white;
}

.swiper-button-next::before {
    transform: translate(-60%, -50%) rotate(45deg);
}

.swiper-button-prev::before {
    transform: translate(-40%, -50%) rotate(-135deg);
}

/* Responsive - make buttons smaller on mobile */
@media (max-width: 768px) {
    .swiper-button-next,
    .swiper-button-prev {
        width: 48px;
        height: 48px;
    }
    
    .swiper-button-next {
        right: 20px;
    }
    
    .swiper-button-prev {
        left: 20px;
    }
    
    .swiper-button-next::before,
    .swiper-button-prev::before {
        width: 10px;
        height: 10px;
        border-width: 2px;
    }
}

.swiper-pagination-bullet {
    background: white;
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    opacity: 1;
}