/**
 * Media Albums Pro - Frontend Styles v1.0.2
 * 
 * Main frontend stylesheet for the Media Albums Pro plugin
 * Includes all styles for album grids, modals, lightbox, sliders and responsive design
 * Updated with dynamic slider controls positioning
 */

/* ================================
   CSS VARIABLES
   ================================ */
:root {
    /* Modal sizing - can be overridden by plugin settings */
    --map-modal-width: 85vw;
    --map-modal-height: 80vh;
    --map-modal-max-width: 1400px;
    --map-modal-max-height: 800px;
    
    /* Common colors */
    --map-primary-color: #666666;
    --map-border-color: #ddd;
    --map-text-color: #333;
    --map-text-muted: #666;
    --map-background-light: #f8f9fa;
    
    /* Transitions */
    --map-transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --map-transition-fast: all 0.3s ease;
}

/* ================================
   BASE STYLES
   ================================ */
.map-albums-grid,
.map-album-content {
    margin: 20px 0;
}

/* ================================
   CATEGORY FILTER SECTION
   ================================ */
.map-category-filter {
    margin: 0 0 25px 0;
    padding: 0;
}

.map-filter-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.map-select-wrapper {
    position: relative;
    min-width: 280px;
    flex: 0 0 auto;
    max-width: 400px;
}

.map-category-select {
    width: 100%;
    padding: 12px 35px 12px 15px;
    border: 2px solid var(--map-border-color);
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: var(--map-text-color);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: var(--map-transition-smooth);
    outline: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.map-category-select:hover {
    border-color: #999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.map-category-select:focus {
    border-color: var(--map-primary-color);
    box-shadow: 0 0 0 3px rgba(102, 102, 102, 0.1);
    transform: translateY(-1px);
}

.map-select-arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--map-text-muted);
    pointer-events: none;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.map-category-select:focus + .map-select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* ================================
   ELEGANT LOADING STATES
   ================================ */
.map-albums-grid.map-loading {
    position: relative;
    transition: var(--map-transition-smooth);
    transform: translateY(10px);
    opacity: 0.7;
}

.map-albums-grid.map-loading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(3px);
    z-index: 10;
    border-radius: 8px;
    animation: fadeInOverlay 0.3s ease;
}

.map-albums-grid.map-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(102, 102, 102, 0.2);
    border-top: 3px solid var(--map-primary-color);
    border-radius: 50%;
    animation: elegantSpin 1s linear infinite;
    z-index: 11;
}

.map-albums-grid-wrapper {
    transition: var(--map-transition-smooth);
}

.map-albums-grid-wrapper.map-filtering {
    transform: translateY(-10px);
    opacity: 0.9;
}

/* Error states for filtering */
.map-filter-error-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: var(--map-background-light);
    border-radius: 8px;
    margin: 20px 0;
}

.map-elegant-error {
    text-align: center;
    max-width: 400px;
    padding: 40px 20px;
}

.map-error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.map-error-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--map-text-color);
    margin-bottom: 10px;
}

.map-error-message {
    color: var(--map-text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.map-retry-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--map-primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--map-transition-fast);
}

.map-retry-filter:hover {
    background: #444;
    transform: translateY(-1px);
}

.map-retry-icon {
    font-size: 14px;
}

/* ================================
   ALBUM COVERS GRID (1-4 COLUMNS)
   ================================ */
.map-albums-grid {
    display: grid;
    gap: 20px;
}

.map-albums-grid.map-columns-1 { grid-template-columns: 1fr; }
.map-albums-grid.map-columns-2 { grid-template-columns: repeat(2, 1fr); }
.map-albums-grid.map-columns-3 { grid-template-columns: repeat(3, 1fr); }
.map-albums-grid.map-columns-4 { grid-template-columns: repeat(4, 1fr); }

.map-album-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: var(--map-transition-fast);
    cursor: pointer;
    width: 100%;
    max-width: none;
}

.map-album-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.map-album-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    width: 100%;
}

.map-album-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--map-transition-fast);
}

.map-album-card:hover .map-album-thumbnail img {
    transform: scale(1.05);
}

.map-no-thumbnail {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--map-text-muted);
}

.map-no-thumbnail .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

.map-album-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.map-album-info {
    padding: 15px;
}

.map-album-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--map-text-color);
    line-height: 1.4;
}

/* ================================
   SINGLE ALBUM HEADER
   ================================ */
.map-single-album {
    margin: 20px 0;
}

.map-album-header {
    margin-bottom: 30px;
    text-align: center;
}

.map-album-description {
    font-size: 16px;
    line-height: 1.6;
    color: var(--map-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ================================
   ALBUM CONTENT LAYOUTS (1-4 COLUMNS)
   ================================ */
.map-album-content {
    display: block !important;
    width: 100% !important;
    overflow: visible !important;
    min-height: auto !important;
}

/* 1 Column Layout */
.map-album-content.map-layout-grid.map-columns-1,
.map-album-content.map-layout-grid.map-columns-1.map-lightbox-enabled {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    width: 100% !important;
    align-items: stretch !important;
    padding: 0 !important;
}

.map-layout-grid.map-columns-1 .map-gallery-item,
.map-layout-grid.map-columns-1 .map-media-item,
.map-layout-grid.map-columns-1 .map-video-item {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    float: none !important;
    clear: both !important;
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
    position: static !important;
    box-sizing: border-box !important;
    flex: none !important;
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
}

/* 2 Columns Layout */
.map-album-content.map-layout-grid.map-columns-2,
.map-album-content.map-layout-grid.map-columns-2.map-lightbox-enabled {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
    width: 100% !important;
    align-items: start !important;
}

.map-layout-grid.map-columns-2 .map-gallery-item,
.map-layout-grid.map-columns-2 .map-media-item,
.map-layout-grid.map-columns-2 .map-video-item {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
    box-sizing: border-box !important;
    flex: none !important;
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
    grid-column: auto !important;
    grid-row: auto !important;
}

/* 3 Columns Layout */
.map-album-content.map-layout-grid.map-columns-3,
.map-album-content.map-layout-grid.map-columns-3.map-lightbox-enabled {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 15px !important;
    width: 100% !important;
    align-items: start !important;
}

.map-layout-grid.map-columns-3 .map-gallery-item,
.map-layout-grid.map-columns-3 .map-media-item,
.map-layout-grid.map-columns-3 .map-video-item {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
    box-sizing: border-box !important;
    flex: none !important;
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
    grid-column: auto !important;
    grid-row: auto !important;
}

/* 4 Columns Layout */
.map-album-content.map-layout-grid.map-columns-4,
.map-album-content.map-layout-grid.map-columns-4.map-lightbox-enabled {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    align-items: start !important;
}

.map-layout-grid.map-columns-4 .map-gallery-item,
.map-layout-grid.map-columns-4 .map-media-item,
.map-layout-grid.map-columns-4 .map-video-item {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: static !important;
    box-sizing: border-box !important;
    flex: none !important;
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
    grid-column: auto !important;
    grid-row: auto !important;
}

/* Common image styles for all column layouts */
.map-layout-grid .map-gallery-item img,
.map-layout-grid .map-media-item img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    object-fit: contain !important;
    position: static !important;
    float: none !important;
    clear: both !important;
    overflow: visible !important;
    min-height: auto !important;
    max-height: none !important;
}

.map-layout-grid .map-lightbox-trigger {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    position: static !important;
    overflow: visible !important;
}

/* Reset positioning for all column layouts */
.map-layout-grid * {
    position: static !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}

/* Legacy compatibility - redirect higher column counts to 2 columns */
.map-layout-grid.map-columns-5,
.map-layout-grid.map-columns-6 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
}

/* ================================
   VIDEO STYLES FOR ALL LAYOUTS
   ================================ */
.map-layout-grid .map-video-item {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #000 !important;
    position: static !important;
    overflow: visible !important;
}

.map-layout-grid .map-video-wrapper {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 56.25% !important;
    overflow: hidden !important;
}

.map-layout-grid .map-video-responsive {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.map-layout-grid .map-video-responsive iframe,
.map-layout-grid .map-video-responsive embed,
.map-layout-grid .map-video-responsive object,
.map-layout-grid .map-video-responsive video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
}

/* Ensure 1 column video same width as images */
.map-layout-grid.map-columns-1 .map-gallery-item,
.map-layout-grid.map-columns-1 .map-media-item,
.map-layout-grid.map-columns-1 .map-video-item,
.map-modal-gallery .map-layout-grid.map-columns-1 .map-gallery-item,
.map-modal-gallery .map-layout-grid.map-columns-1 .map-media-item,
.map-modal-gallery .map-layout-grid.map-columns-1 .map-video-item {
    width: 100% !important;
    max-width: 98% !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

.map-layout-grid.map-columns-1 .map-video-wrapper,
.map-modal-gallery .map-layout-grid.map-columns-1 .map-video-wrapper {
    width: 100% !important;
    max-width: 98% !important;
    margin: 0 auto !important;
    position: relative !important;
    height: 0 !important;
    padding-bottom: 56.25% !important;
}

/* ================================
   MODAL GALLERY STYLES
   ================================ */
.map-album-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(240, 240, 240, 0.9);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 5vh 5vw;
}

.map-album-modal.active {
    opacity: 1;
    visibility: visible;
}

.map-album-modal-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    width: var(--map-modal-width) !important;
    height: var(--map-modal-height) !important;
    max-width: var(--map-modal-max-width) !important;
    max-height: var(--map-modal-max-height) !important;
    overflow: hidden;
    position: relative;
    display: flex;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: none;
}

.map-album-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--map-transition-fast);
    z-index: 10;
    backdrop-filter: blur(10px);
}

.map-album-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.map-modal-left-column {
    flex: 2;
    background: transparent;
    overflow: hidden;
    height: 100%;
    position: relative;
}

.map-modal-right-column {
    flex: 1;
    padding: 30px 25px;
    overflow-y: auto;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}

.map-modal-gallery {
    padding: 0 !important;
    overflow-y: auto;
    height: 100%;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    background: var(--map-background-light);
}

.map-modal-gallery .map-album-content {
    margin: 0;
    width: 100% !important;
    height: auto !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
}

/* Modal grid layouts */
.map-modal-gallery .map-layout-grid.map-columns-1,
.map-modal-gallery .map-album-content.map-layout-grid.map-columns-1 {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    width: 100% !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 5px !important;  
    padding-top: 15px !important;
    margin: 0 !important;
    align-content: start !important;
    position: relative !important;
    top: 0 !important;
    transform: none !important;
}

.map-modal-gallery .map-layout-grid.map-columns-2,
.map-modal-gallery .map-album-content.map-layout-grid.map-columns-2 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-auto-rows: auto !important;
    gap: 20px !important;
    align-items: start !important;
    align-content: start !important;
    justify-content: start !important;
    padding: 20px !important;
    height: auto !important;
    margin: 0 !important;
    width: 100% !important;
    position: relative !important;
    top: 0 !important;
}

.map-modal-gallery .map-layout-grid.map-columns-3,
.map-modal-gallery .map-album-content.map-layout-grid.map-columns-3 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-auto-rows: auto !important;
    gap: 15px !important;
    align-items: start !important;
    align-content: start !important;
    padding: 20px !important;
    height: auto !important;
    margin: 0 !important;
    width: 100% !important;
}

.map-modal-gallery .map-layout-grid.map-columns-4,
.map-modal-gallery .map-album-content.map-layout-grid.map-columns-4 {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-auto-rows: auto !important;
    gap: 10px !important;
    align-items: start !important;
    align-content: start !important;
    padding: 20px !important;
    height: auto !important;
    margin: 0 !important;
    width: 100% !important;
}

/* Modal scrollbar styling */
.map-modal-gallery.map-scrollable-content {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scroll-behavior: smooth !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent !important;
}

.map-modal-gallery.map-scrollable-content::-webkit-scrollbar {
    width: 8px !important;
}

.map-modal-gallery.map-scrollable-content::-webkit-scrollbar-track {
    background: transparent !important;
}

.map-modal-gallery.map-scrollable-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 4px !important;
}

.map-modal-gallery.map-scrollable-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4) !important;
}

/* Modal album info styles */
.map-modal-album-header {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.map-modal-album-title {
    font-size: 20px;
    color: var(--map-text-color);
    margin-bottom: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.map-modal-album-description {
    color: var(--map-text-muted);
    line-height: 1.6;
    font-size: 13px;
    margin-bottom: 20px;
}

.map-modal-custom-fields {
    margin-top: 40px;
}

.map-custom-field-item {
    background: rgba(248, 249, 250, 0.8);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    backdrop-filter: blur(5px);
}

.map-custom-field-title {
    font-weight: 600;
    color: var(--map-text-color);
    font-size: 14px;
    margin-bottom: 5px;
}

.map-custom-field-description {
    color: var(--map-text-muted);
    line-height: 1.6;
    font-size: 13px;
}

/* Global modal loading */
.map-modal-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(248, 249, 250, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 100;
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.map-modal-loading .map-loading-spinner,
.map-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--map-primary-color);
    border-radius: 50%;
    animation: map-spin 1s linear infinite;
    margin-bottom: 20px;
}

.map-modal-loading p,
.map-loading-content p {
    color: var(--map-text-muted);
    font-size: 15px;
    margin: 0;
    font-weight: 500;
}

.map-loading-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 200px !important;
    padding: 60px 40px !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(248, 249, 250, 0.95) !important;
    z-index: 5 !important;
}

/* ================================
   SLIDER LAYOUT STYLES
   ================================ */
.map-layout-slider {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    padding-top: 20px;
    box-sizing: border-box;
}

.map-slider-container {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    width: 100%;
    height: calc(100% - 20px);
    padding-bottom: 40px;
    min-height: 300px; /* Minimum height to prevent layout shift */
}

.map-slider-wrapper {
    display: flex;
    transition: transform 0.5s ease;
    width: 100%;
    height: calc(100% - 40px);
}

.map-slider-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--map-background-light);
    padding: 10px;
    box-sizing: border-box;
    min-height: 250px; /* Consistent slide height */
}

.map-slider-slide .map-media-item {
    width: 100%;
    height: 100%;
    border-radius: 0;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
}

.map-slider-slide img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    transition: opacity 0.3s ease; /* Smooth loading transition */
}

/* Modal slider layout */
.map-modal-gallery .map-layout-slider {
    margin: 0;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    position: relative !important;
    overflow: hidden !important;
    padding-top: 20px !important;
    box-sizing: border-box !important;
}

.map-modal-gallery .map-slider-container {
    width: 100% !important;
    height: calc(100% - 20px) !important;
    position: relative !important;
    overflow: hidden !important;
    padding-bottom: 40px !important;
}

.map-modal-gallery .map-slider-wrapper {
    width: 100% !important;
    height: calc(100% - 40px) !important;
    display: flex !important;
    transition: transform 0.5s ease !important;
}

.map-modal-gallery .map-slider-slide {
    flex: 0 0 100% !important;
    margin-top: 20px !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--map-background-light) !important;
    padding: 10px !important;
    box-sizing: border-box !important;
}

.map-modal-gallery .map-slider-slide .map-media-item {
    width: 100% !important;
    height: calc(100% - 50px) !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.map-modal-gallery .map-slider-slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Slider videos */
.map-slider-slide .map-video-item,
.map-modal-gallery .map-slider-slide .map-video-item {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.map-slider-slide .map-video-wrapper,
.map-modal-gallery .map-slider-slide .map-video-wrapper {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 56.25% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* ================================
   DYNAMIC SLIDER CONTROLS WITH IMPROVED POSITIONING
   ================================ */

/* Navigation controls with enhanced styling */
.map-slider-nav {
    position: absolute;
    top: 10px;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(5px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    transition: all 0.3s ease !important;
    z-index: 25 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.map-slider-nav:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    transform: scale(1.05) !important;
}

.map-slider-prev { left: 10px; }
.map-slider-next { left: 50px; }

.map-slider-nav:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.map-slider-nav:disabled:hover {
    background: rgba(0, 0, 0, 0.7) !important;
    transform: none !important;
}

/* Counter with enhanced styling */
.map-slider-counter {
    position: absolute;
    top: 10px;
    left: 90px;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(5px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    height: 32px;
    min-height: 32px;
    box-sizing: border-box;
    z-index: 25 !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: auto !important;
    transition: top 0.3s ease, bottom 0.3s ease !important;
}

/* Dots with enhanced styling and positioning */
.map-slider-dots,
.map-modal-gallery .map-slider-dots {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    background-color: transparent !important;
    position: absolute !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 25 !important;
    border: none !important;
    border-radius: 0 !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    outline: none !important;
    width: auto !important;
    height: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: top 0.3s ease, bottom 0.3s ease !important;
}

.map-slider-dot {
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: 2px solid rgba(0, 0, 0, 0.4) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    outline: none !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

.map-slider-dot:hover {
    background: rgba(255, 255, 255, 1) !important;
    border-color: rgba(0, 0, 0, 0.6) !important;
    transform: scale(1.2) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

.map-slider-dot.active {
    background: var(--map-primary-color) !important;
    border-color: rgba(255, 255, 255, 0.9) !important;
    transform: scale(1.4) !important;
    box-shadow: 0 3px 8px rgba(102, 102, 102, 0.5) !important;
}

/* Hide scrollbar when slider is active */
.map-modal-gallery:has(.map-layout-slider) {
    overflow: hidden !important;
}

/* ================================
   MEDIA ITEMS
   ================================ */
.map-media-item {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    transition: none;
}

.map-media-item:hover {
    transform: none;
    box-shadow: none;
}

.map-gallery-item {
    width: 100%;
}

.map-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: none;
    border-radius: 0;
}

.map-gallery-item a:hover img {
    transform: none;
}

.map-video-item {
    background: #000;
    width: 100%;
}

.map-video-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    overflow: hidden;
}

.map-video-responsive {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.map-video-responsive iframe,
.map-video-responsive embed,
.map-video-responsive object,
.map-video-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.map-item-caption {
    padding: 12px 0;
    background: transparent;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    border-top: none;
}

.map-layout-grid .map-video-item .map-item-caption {
    padding: 12px 0 !important;
    background: transparent !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #555 !important;
    text-align: center !important;
}

.map-modal-gallery .map-item-caption {
    padding: 8px 0 !important;
    margin: 0 !important;
    background: transparent !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    color: #555 !important;
    text-align: center !important;
}

/* ================================
   LIGHTBOX STYLES
   ================================ */
.map-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.map-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.map-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    margin: auto;
}

.map-lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.map-lightbox-caption {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    color: white;
    text-align: center;
    font-size: 14px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.map-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    transition: background-color 0.3s ease;
    border-radius: 4px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.map-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-radius: 4px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.map-lightbox-prev { left: -80px; }
.map-lightbox-next { right: -80px; }

/* ================================
   ANIMATIONS
   ================================ */
@keyframes map-spin {
    to { transform: rotate(360deg); }
}

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

@keyframes fadeInOverlay {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

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

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

.map-modal-left-column { animation: slideInFromLeft 0.5s ease-out; }
.map-modal-right-column { animation: slideInFromRight 0.5s ease-out; }

/* Loading state for images */
.map-slider-slide img[src=""],
.map-slider-slide img:not([src]) {
    opacity: 0 !important;
}

.map-slider-slide img[src]:not([src=""]) {
    opacity: 1 !important;
}

/* ================================
   BODY STATES
   ================================ */
body.map-modal-open,
body.map-lightbox-open {
    overflow: hidden;
}

/* ================================
   UTILITY CLASSES
   ================================ */
.map-clickable { cursor: pointer; }
.map-no-albums { text-align: center; padding: 40px; color: var(--map-text-muted); font-style: italic; }
.map-empty-album { text-align: center; padding: 60px 20px; color: var(--map-text-muted); }
.map-empty-album::before { content: "📁"; font-size: 3em; display: block; margin-bottom: 15px; }
.map-error { padding: 20px; background: #f8d7da; color: #721c24; border-radius: 8px; text-align: center; margin: 20px; border: 1px solid #f1aeb5; }
.map-error::before { content: "⚠️"; font-size: 1.5em; margin-right: 10px; }

/* Scrollbar styling for modal columns */
.map-modal-left-column::-webkit-scrollbar,
.map-modal-right-column::-webkit-scrollbar { width: 8px; }
.map-modal-left-column::-webkit-scrollbar-track,
.map-modal-right-column::-webkit-scrollbar-track { background: transparent; }
.map-modal-left-column::-webkit-scrollbar-thumb,
.map-modal-right-column::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.2); border-radius: 4px; }
.map-modal-left-column::-webkit-scrollbar-thumb:hover,
.map-modal-right-column::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.4); }

/* Focus styles for accessibility */
.map-lightbox-trigger:focus,
.map-album-card:focus { outline: 2px solid var(--map-primary-color); outline-offset: 2px; }
.map-lightbox-close:focus,
.map-lightbox-nav:focus,
.map-album-modal-close:focus,
.map-slider-nav:focus,
/* ================================
   RESPONSIVE DESIGN
   ================================ */
@media (max-width: 1024px) {
    .map-albums-grid.map-columns-3,
    .map-albums-grid.map-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .map-album-modal { 
        padding: 2vh 2vw; 
    }
    
    .map-album-modal-content { 
        width: min(calc(var(--map-modal-width) + 6vw), 96vw) !important;
        height: min(calc(var(--map-modal-height) + 10vh), 90vh) !important;
    }
    
    .map-modal-left-column { flex: 1.8; }
    .map-modal-right-column { flex: 1.2; padding: 25px 20px; }
    
    .map-layout-grid.map-columns-4,
    .map-modal-gallery .map-layout-grid.map-columns-4,
    .map-album-content.map-layout-grid.map-columns-4 {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
    }
    
    .map-filter-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .map-select-wrapper {
        max-width: 100%;
        min-width: 250px;
    }
    
    /* Tablet slider controls */
    .map-slider-nav {
        width: 36px !important;
        height: 36px !important;
        font-size: 16px !important;
    }
    
    .map-slider-counter {
        height: 36px !important;
        min-height: 36px !important;
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
    
    .map-slider-dot {
        width: 8px !important;
        height: 8px !important;
    }
    
    .map-slider-container {
        min-height: 250px !important;
    }
    
    .map-slider-slide {
        min-height: 200px !important;
    }
}

@media (max-width: 768px) {
    .map-albums-grid.map-columns-2,
    .map-albums-grid.map-columns-3,
    .map-albums-grid.map-columns-4 {
        grid-template-columns: 1fr;
    }
    
    .map-layout-grid.map-columns-2,
    .map-layout-grid.map-columns-3,
    .map-layout-grid.map-columns-4,
    .map-modal-gallery .map-layout-grid.map-columns-2,
    .map-modal-gallery .map-layout-grid.map-columns-3,
    .map-modal-gallery .map-layout-grid.map-columns-4,
    .map-album-content.map-layout-grid.map-columns-2,
    .map-album-content.map-layout-grid.map-columns-3,
    .map-album-content.map-layout-grid.map-columns-4 {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    .map-album-modal { 
        padding: 1vh 1vw; 
    }
    
    .map-album-modal .map-album-modal-content {
        width: 98vw !important;
        height: 95vh !important;
        flex-direction: column;
        border-radius: 6px;
    }
    
    .map-modal-left-column,
    .map-modal-right-column { flex: none; }
    .map-modal-left-column { height: 65%; }
    .map-modal-right-column {
        height: 35%;
        padding: 20px 15px;
        border-left: none;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .map-modal-album-title { font-size: 1.4em; }
    .map-album-modal-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .map-slider-dots {
        bottom: 10px !important;
        gap: 8px !important;
    }
    
    .map-slider-dot {
        width: 6px !important;
        height: 6px !important;
        border-width: 1px !important;
    }
    
    .map-slider-container {
        padding-bottom: 35px !important;
        height: calc(100% - 15px) !important;
        min-height: 200px !important;
    }
    
    .map-slider-wrapper {
        height: calc(100% - 35px) !important;
    }
    
    .map-layout-slider,
    .map-modal-gallery .map-layout-slider {
        padding-top: 15px !important;
    }
    
    .map-modal-gallery .map-slider-container {
        height: calc(100% - 15px) !important;
    }
    
    .map-category-filter {
        margin: 0 0 20px 0;
    }
    
    .map-filter-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .map-select-wrapper {
        max-width: 100%;
        min-width: auto;
    }
    
    .map-category-select {
        padding: 10px 30px 10px 12px;
        font-size: 13px;
    }
    
    .map-select-arrow {
        right: 12px;
        font-size: 10px;
    }
    
    /* Mobile slider controls */
    .map-slider-nav {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
    }
    
    .map-slider-counter {
        height: 40px !important;
        min-height: 40px !important;
        padding: 10px 14px !important;
        font-size: 14px !important;
    }
    
    .map-slider-dot {
        width: 12px !important;
        height: 12px !important;
    }
    
    .map-slider-dots {
        gap: 10px !important;
    }
    
    .map-slider-slide {
        min-height: 180px !important;
    }
	.map-slider-prev { 
        left: 8px !important; 
    }
    
    .map-slider-next { 
        left: 56px !important; /* Mais espaço do botão anterior */
    }
    
    .map-slider-counter { 
        left: 112px !important; /* Mais espaço do botão próximo */
        min-width: 45px !important;
        text-align: center !important;
    }
}

@media (max-width: 480px) {
    .map-albums-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .map-album-header .map-album-title { font-size: 20px; }
    .map-album-info { padding: 12px; }
    .map-item-caption { padding: 10px 12px; font-size: 13px; }
    .map-album-modal { padding: 1vh 1vw; }
    
    .map-album-modal .map-album-modal-content { 
        width: 98vw !important; 
        height: 98vh !important; 
        border-radius: 8px; 
    }
    
    .map-modal-right-column { padding: 20px 15px; }
    .map-modal-album-title { font-size: 1.4em; }
    .map-custom-field-title { font-size: 1em; }
    .map-custom-field-description { font-size: 0.9em; }
    .map-modal-gallery { padding: 0; }
    
    .map-slider-container { 
        border-radius: 8px; 
        height: calc(100% - 15px) !important; 
        padding-bottom: 35px !important; 
    }
    
    .map-slider-wrapper { height: calc(100% - 35px) !important; }
    
    .map-slider-slide { 
        min-height: 250px; 
        height: 100% !important; 
        padding: 5px !important; 
    }
    
    .map-album-modal-close { 
        top: 10px; 
        right: 10px; 
        width: 32px; 
        height: 32px; 
        font-size: 16px; 
    }
    
    .map-slider-nav { 
        width: 40px; 
        height: 40px; 
        font-size: 16px; 
        top: 5px; 
    }
    
    .map-slider-prev { left: 10px; }
    .map-slider-next { left: 50px; }
    
    .map-slider-counter { 
        top: 5px; 
        height: 40px; 
        min-height: 40px; 
    }
    
    .map-category-select {
        padding: 8px 25px 8px 10px;
        font-size: 12px;
    }
    
    .map-select-arrow {
        right: 8px;
        font-size: 10px;
    }
    
    .map-filter-wrapper {
        justify-content: stretch;
    }
    
    .map-select-wrapper {
        min-width: auto;
        flex: 1;
    }
	
	.map-slider-prev { 
        left: 6px !important; 
    }
    
    .map-slider-next { 
        left: 52px !important; 
    }
    
    .map-slider-counter { 
        left: 104px !important;
        min-width: 40px !important;
        font-size: 12px !important;
        padding: 8px 10px !important;
    }
}

/* ================================
   PRINT STYLES
   ================================ */
@media print {
    .map-lightbox-overlay,
    .map-lightbox-nav,
    .map-lightbox-close,
    .map-album-modal,
    .map-slider-nav,
    .map-slider-dots,
    .map-category-filter { 
        display: none !important; 
    }
    
    .map-layout-slider .map-slider-slide { 
        display: block; 
        page-break-inside: avoid; 
    }
    
    .map-media-item { 
        break-inside: avoid; 
        margin-bottom: 15px; 
    }
}