/**
 * Artflow Pro Portfolio Manager Styles
 *
 * Organized by:
 * 1. Common elements
 * 2. Card Layout - Base styles
 * 3. Column Layout Classes
 * 4. Style 1 (Minimal) - All style 1 specific CSS
 * 5. Style 2 (Light with description) - All style 2 specific CSS
 * 6. Style 3 (Full dark) - All style 3 specific CSS
 * 7. Style 4 (Custom) - All style 4 specific CSS 
 * 8. Style 5 (Carousel) - All style 5 specific CSS 
 * 9. Lightbox styles
 * 10. Responsive styles
 */

/* ================== 1. Common Elements ================== */
.portfolio-header {
    margin: 20px 0;
    text-align: center;
}
.portfolio-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}
.portfolio-header p {
    font-size: 18px;
    color: #555;
}

/* Card container - controls grid layout */
.card-container {
    display: grid;
    gap: 15px;
    padding: 5px 0 10px;
}

/**
 * Additional styles for better loading experience
 */

/* Portfolio container loading state */
.artflow-portfolio-container {
    min-height: 200px;
    position: relative;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Add a class that will be applied when the content is loaded */
.artflow-portfolio-loaded {
    opacity: 1;
    min-height: auto;
}

/* Loading spinner wrapper */
.artflow-loading-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
    width: 100%;
}

/* Loading spinner animation */
@keyframes artflow-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.artflow-loading-wrapper .dashicons {
    display: block;
    margin: 0 auto 10px;
    font-size: 24px;
    animation: artflow-spin 2s infinite linear;
}

/* Error message styling */
.artflow-error {
    text-align: center;
    padding: 20px;
    background: #fff8f8;
    border: 1px solid #ffd6d6;
    color: #d32f2f;
    border-radius: 4px;
}

/* ================== 2. Card Layout - Base Styles ================== */
.card {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}
.card-image-container {
    position: relative;
    overflow: hidden;
}
.card-image-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.card:hover .card-image-container img {
    transform: scale(1.05);
}
.card-content {
    flex-grow: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.card h2 {
    font-size: 16px;
    margin: 0 0 10px 0;
    line-height: 1.3;
    font-weight: 600;
}
.card-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.card-description {
    font-size: 13px;
    margin-bottom: 10px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.card-metadata {
    margin-top: auto;
    font-size: 12px;
    margin-bottom: 10px;
}
.card-series,
.card-material {
    margin-bottom: 6px;
}
.metadata-label {
    font-weight: 600;
    margin-right: 5px;
}
.metadata-value {
    font-style: italic;
}
.card-features {
    margin-bottom: 10px;
}
.feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}
.feature-tag {
    background: #7e7e7e;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 600;
    display: inline-block;
}
.feature-more {
    background: #efefef;
    color: #555;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 600;
    display: inline-block;
}
.view-details-btn {
    margin-top: auto;
    padding: 6px 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    align-self: flex-start;
}
.view-details-btn:hover {
    background: #e0e0e0;
}

/* Attachment rows (used in style 4) */
.attachment-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #777;
    padding: 5px 0;
    border-top: 1px solid #f0f0f0;
}
.attachment-label {
    font-size: 11px;
    color: #999;
}
.attachment-value {
    font-size: 11px;
    color: #555;
}

/* ================== 3. Column Layout Classes ================== */

/* Pre-defined column layouts instead of inline styles */
.columns-1 {
    grid-template-columns: repeat(1, 1fr);
}
.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}
.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}
.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}
.columns-5 {
    grid-template-columns: repeat(5, 1fr);
}
.columns-6 {
    grid-template-columns: repeat(6, 1fr);
}
.columns-7 {
    grid-template-columns: repeat(7, 1fr);
}
.columns-8 {
    grid-template-columns: repeat(8, 1fr);
}

/* Style 4 grid overrides columns classes */
.style-4-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

/* Then add a style-specific override for style-4 cards */
.card-container .card.style-4 {
    min-width: 300px;
}

/* Special column handling for style 4 */
.card-container:has(.style-4) {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
}

/* Fallback for browsers that don't support :has() */
@supports not (selector(:has(*))) {
    .columns-1:has(.style-4),
    .columns-2:has(.style-4),
    .columns-3:has(.style-4),
    .columns-4:has(.style-4),
    .columns-5:has(.style-4),
    .columns-6:has(.style-4),
    .columns-7:has(.style-4),
    .columns-8:has(.style-4) {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* ================== 4. Style 1 (Minimal) ================== */

.artflow-style-1 {
    background-color: #fff;
}

.artflow-style-1 .portfolio-header {
    background-color: #fff;
    color: black;
    padding: 30px 20px;
    margin: 0 0 30px 0;
    text-align: center;
}

.artflow-style-1 .portfolio-header h1 {
    color: black;
    font-size: 32px;
    margin-bottom: 15px;
}

.artflow-style-1 .portfolio-header p {
    color: #ccc;
    font-size: 16px;
    max-width: 700px;
    margin: 0 auto;
}

.card.style-1 {
    background: #888;
}

.card.style-1:hover {
    cursor: pointer;
}

.card.style-1 h2 {
    color: white;
    margin-bottom: 0;
    text-align: center;
    text-transform: capitalize;
    font-size: 14px;
    width: 100%;
}

.card.style-1 .card-content {
    display: flex;
    align-items: center;
    flex-direction: row;
}

.card.style-1 .card-description,
.card.style-1 .card-metadata,
.card.style-1 .card-features,
.card.style-1 .view-details-btn {
    display: none; /* Hide additional info for Style 1 */
}

/* ================== 5. Style 2 (Light with description) ================== */
.artflow-style-2 {
    background-color: white;
}

.artflow-style-2 .portfolio-header {
    text-align: center;
    padding: 40px 20px;
    margin: 0 0 20px 0;
    border-bottom: 1px solid #eaeaea;
}

.artflow-style-2 .portfolio-header h1 {
    color: #333;
    font-size: 36px;
    margin-bottom: 15px;
}

.artflow-style-2 .portfolio-header p {
    color: #666;
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.card.style-2 {
    background: #fff;
    border: none;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    padding: 10px 10px 40px 10px;
}

/* Style 2 container has white background and padding */
.style-2-container {
    background-color: #fff;
    padding: 30px;
}

/* Hide title, description and button by default */
.card.style-2 .card-content {
    position: absolute;
    bottom: -26px;
    left: 0;
    right: 0;
    background: transparent;
    padding: 15px;
    opacity: 0;
    /* transform: translateY(100%); */
    transition: opacity 0.5s ease-out 0s;
    transition-delay: 0.2s;
    text-align: center;
}

.card.style-2 h2 {
    color: #999 !important;
    margin: 0;
    font-size: 11px;
    text-align: center;
    text-transform: uppercase;
    line-height: 1.2em;
}

.card.style-2 .card-description,
.card.style-2 .card-metadata,
.card.style-2 .card-features,
.card.style-2 .view-details-btn {
    display: none; /* Hide all additional info for Style 2 */
}

/* Enhance hover effect */
.card.style-2:hover .card-image-container img {
    transform: scale(1.03); /* Slightly larger scale on hover */
    cursor: pointer;
}

.card.style-2:hover .card-content {
    opacity: 1;
    cursor: pointer;
}

/* Adjust image container for better proportions */
.card.style-2 .card-image-container {
    margin: 0;
    padding: 0;
    border-radius: 12px
}

/* White background for the grid */
.card-container:has(.style-2) {
    background-color: #fff;
    padding: 30px;
}

/* Fallback for browsers that don't support :has() */
.columns-1 .style-2,
.columns-2 .style-2,
.columns-3 .style-2,
.columns-4 .style-2,
.columns-5 .style-2,
.columns-6 .style-2,
.columns-7 .style-2,
.columns-8 .style-2 {
    background-color: #fff;
}

/* Admin preview styles for Style 2 */
#admin-preview-modal .card.style-2 {
    background: #fff;
    border: none;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    padding: 30px;
}

#admin-preview-modal .card.style-2 .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    padding: 15px;
    text-align: center;
}

#admin-preview-modal .card.style-2 h2 {
    color: #333;
    margin: 0;
    font-size: 16px;
    text-align: center;
}

#admin-preview-modal .card.style-2 .card-description,
#admin-preview-modal .card.style-2 .card-metadata,
#admin-preview-modal .card.style-2 .card-features,
#admin-preview-modal .card.style-2 .view-details-btn {
    display: none;
}

#admin-preview-modal .card.style-2 .card-image-container {
    margin: 0;
    padding: 0;
}

/* Style indicator for admin preview */
#admin-preview-modal .style-indicator + .card-container {
    background-color: #fff;
    padding: 30px;
}


/* ================== 6. Style 3 (Full dark) ================== */
.artflow-style-3 {
    background-color: #222;
    padding: 30px;
}

.artflow-style-3 .portfolio-header {
    text-align: center;
    padding: 30px 20px;
    margin: 0 0 30px 0;
    border-bottom: 1px solid #444;
}

.artflow-style-3 .portfolio-header h1 {
    color: white;
    font-size: 40px;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.artflow-style-3 .portfolio-header p {
    color: #aaa;
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.card-container.columns-3 {
    background: #111;
    padding: 50px 30px;
}

.card.style-3 {
    background: #111;
    color: white;
    border: 1px solid #555;
}

.card.style-3:hover { 
    cursor: pointer;
    border: 1px solid #999;
}   

.card.style-3 .portfolio-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: white;
} 

.card.style-3 .card-content h2 {
    color: white;
    text-transform: capitalize;
    width: 100%;
    text-align: center;
} 

.card.style-3 .portfolioDescription {
    color: #fff;
}

.card.style-3 .card-description {
    color: #ddd;
    display: -webkit-box;
}
.card.style-3 .card-metadata {
    display: block;
}
.card.style-3 .metadata-label,
.card.style-3 .metadata-value {
    color: #ddd;
}
.card.style-3 .feature-tag {
    background: #555;
}
.card.style-3 .feature-more {
    background: #555;
    color: #ddd;
}
.card.style-3 .view-details-btn {
    display: block;
    background: #555;
    color: #fff;
    border-color: #666;
    display: none;
}
.card.style-3 .view-details-btn:hover {
    background: #666;
}

/* ================== 7. Style 4 (Custom) ================== */
.artflow-style-4 {
    background-color: #fff;
    padding: 20px 0 40px;
}

.artflow-style-4 .portfolio-header {
    text-align: center;
    padding: 30px 20px 40px;
    margin: 0 0 20px 0;
}

.artflow-style-4 .portfolio-header h1 {
    color: #604c3c;
    font-size: 38px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 15px;
}

.artflow-style-4 .portfolio-header h1::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #604c3c;
}

.artflow-style-4 .portfolio-header p {
    color: #333;
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

.card.style-4 {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 0;
    border: 1px solid #f0f0f0;
    position: relative;
    padding-bottom: 90px;
}
.card.style-4:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.card.style-4 .card-image-container {
    background: #fff;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f5f5f5;
}
.card.style-4 .card-image-container img {
    max-height: 220px;
    width: auto;
    object-fit: contain;
}
.card.style-4 .card-content {
    padding: 15px;
    background: #fff;
}
.card.style-4 h2 {
    color: #604c3c;
    font-size: 16px;
    margin: 0 0 0px 0;
    line-height: 1.4;
    font-weight: 600;
    border-bottom: none;
}
.card.style-4 .card-description {
    color: #555;
    font-size: 13px;
    margin-bottom: 0px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card.style-4 .card-metadata {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}
.card.style-4 .card-series,
.card.style-4 .card-material {
    margin-bottom: 0px;
    color: #777;
    font-size: 13px;
}
.card.style-4 .metadata-label {
    font-weight: 600;
    margin-right: 5px;
    color: #604c3c;
    min-width: 65px;
    display: inline-block;
}
.card.style-4 .metadata-value {
    font-style: normal;
    color: #555;
}
.card.style-4 .card-features {
    margin: 12px 0;
}
.card.style-4 .feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.card.style-4 .feature-tag {
    background: #f5f5f5;
    color: #555;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: normal;
    border: 1px solid #e9e9e9;
}
.card.style-4 .feature-more {
    background: #fff;
    color: #999;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: normal;
    border: 1px solid #e9e9e9;
}
.card.style-4 .view-details-btn {
    margin-top: 12px;
    width: 100%;
    padding: 8px;
    background: #fff;
    color: #604c3c;
    border: 1px solid #604c3c;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;    
    position: absolute;
    bottom: 14px;
    width: 88%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.card.style-4 .view-details-btn:hover {
    background: #604c3c;
    color: #fff;
}
.card.style-4 .attachment-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #777;
    padding: 0;
    border-top: 1px solid #f0f0f0;
}
.card.style-4 .attachment-label {
    font-size: 11px;
    color: #999;
}
.card.style-4 .attachment-value {
    font-size: 11px;
    color: #555;
}

/* ================== 8. Style 5 (Carousel) ================== */

/**
 * Style 5 - Carousel
 * CSS for the carousel portfolio style
 */
 .artflow-style-5 {
    background-color: #f8f8f8;
    padding: 30px 0;
    position: relative;
}

.artflow-style-5 .portfolio-header {
    text-align: center;
    padding: 0 20px 30px;
    margin: 0 auto;
    max-width: 900px;
}

.artflow-style-5 .portfolio-header h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 15px;
}

.artflow-style-5 .portfolio-header p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

/* Carousel Container */

/* Carousel Container */
.carousel-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
}

/* Carousel Track */
.carousel-track {
    display: flex;
    transition: transform 1.5s ease;
}

/* Carousel Slides */
.carousel-slide {
    flex: 0 0 auto;
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
    transition: opacity 0.3s ease;
}

.carousel-slide .card.style-5 h2 {
    font-size: 14px;
    color: #333;
    margin: 0 0 10px;
    line-height: 1.3;
}

/* Responsive slide widths - these values must match getSlidesToShow() */
@media (min-width: 768px) {
    .carousel-slide {
        width: 50%; /* 2 slides */
    }
}

@media (min-width: 992px) {
    .carousel-slide {
        width: 33.333%; /* 3 slides */
    }
}

@media (min-width: 1200px) {
    .carousel-slide {
        width: 25%; /* 4 slides */
    }
}

/* Navigation Buttons */
.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
    transition: all 0.3s ease;
}

.carousel-button:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.carousel-button-prev {
    left: 20px;
}

.carousel-button-next {
    right: 20px;
}

/* Indicators - now representing pages rather than slides */
.carousel-indicators {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    margin: 0 5px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.carousel-indicator.active {
    background: #666;
    transform: scale(1.2);
}

/* Autoplay Control Button */
.carousel-autoplay-control {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #ddd;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
    outline: none;
}

.carousel-autoplay-control:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.carousel-autoplay-control.playing {
    color: #d32f2f; /* Red color for pause button */
}

.carousel-autoplay-control.paused {
    color: #388e3c; /* Green color for play button */
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .carousel-button {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .carousel-button-prev {
        left: 10px;
    }
    
    .carousel-button-next {
        right: 10px;
    }
    
    .carousel-autoplay-control {
        width: 30px;
        height: 30px;
        font-size: 12px;
        bottom: 10px;
        right: 10px;
    }
}

/* Adjust placement for different screen sizes */
@media (max-width: 768px) {
    .carousel-autoplay-control {
        width: 30px;
        height: 30px;
        font-size: 12px;
        bottom: 10px;
        right: 10px;
    }
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .carousel-button {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .carousel-button-prev {
        left: 10px;
    }
    
    .carousel-button-next {
        right: 10px;
    }
}

/* ================== Style 6 - Slideshow ================== */
.artflow-style-6 {
    background-color: #ffffff;
    padding: 30px 0;
    position: relative;
}

.artflow-style-6 .portfolio-header {
    text-align: center;
    padding: 0 20px 30px;
    margin: 0 auto;
    max-width: 1200px;
}

.artflow-style-6 .portfolio-header h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 15px;
}

.artflow-style-6 .portfolio-header p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

/* Slideshow Container */
.slideshow-container {
    position: relative;
    width: 100%;
    max-width: 1600px; /* Increased to 1600px */
    margin: 0 auto;
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
    z-index: 100;
}

/* Slideshow Slides */
.slideshow-slides {
    position: relative;
    min-height: 600px; /* Increased height to accommodate 2:1 images */
    padding: 13px 30px;
}

.slideshow-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 0s linear 1s;
    display: flex;
    flex-direction: row;
    padding: 30px;
    box-sizing: border-box;
}

.slideshow-slides:hover {
    cursor: pointer;
}

/* Important: Make active slide visible */
.slideshow-slide.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 1s ease, visibility 0s linear;
    z-index: 1;
}

/* Image Section - Now 50% width */
.slideshow-image-section {
    flex: 1;
    max-width: 50%;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    box-sizing: border-box;
}

.slideshow-image-wrapper {
    width: 100%;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    /* Create container with 2:1 aspect ratio */
    padding-top: 100%; /* 1:1 aspect ratio */
}

/* Position image properly within the wrapper to maintain 2:1 ratio */
.slideshow-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* This ensures the image covers the entire container */
    border-radius: 4px;
}

/* Content Section - Now 50% width */
.slideshow-content-section {
    flex: 1;
    max-width: 50%;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    overflow-y: auto; /* Allow scrolling if needed */
    max-height: 540px; /* Limit height to prevent overflow */
}

/* Slideshow Content Styling */
h2.slideshow-title {
    font-size: 30px !important;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
}

.slideshow-description {
    font-size: 14px;
    line-height: 1.4;
    color: #555;
    margin-bottom: 18px;
}

.slideshow-metadata {
    margin-bottom: 25px;
    padding: 10px;
    background: #efefef;
    border-radius: 4px;
    border: 1px solid #ddd;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

.slideshow-series,
.slideshow-material {
    display: flex;
    margin-bottom: 0px;
    font-size: 12px;
}

.slideshow-metadata-label {
    font-weight: 600;
    min-width: 80px;
    color: #666;
}

.slideshow-metadata-value {
    color: #333;
}

.slideshow-features {
    margin-top: 15px;
    font-size: 12px;
}

.slideshow-features-label {
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

ul.slideshow-features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    list-style: none !important;
}

.slideshow-feature-tag {
    background: #585858;
    color: #fff;
    padding: 1px 14px;
    border-radius: 20px;
    font-size: 11px;
}

/* Navigation Controls */
.slideshow-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #333;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.slideshow-nav:hover {
    opacity: 1;
    background: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.slideshow-prev {
    left: 20px;
}

.slideshow-next {
    right: 20px;
}

/* Indicators */
.slideshow-indicators {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    z-index: 200;
}

.slideshow-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slideshow-indicator.active {
    background: #333;
    transform: scale(1.2);
}

/* Autoplay Control Button */
.slideshow-autoplay-control {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
    outline: none;
}

.slideshow-autoplay-control:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.slideshow-autoplay-control.playing {
    color: #d32f2f; /* Red color for pause button */
}

.slideshow-autoplay-control.paused {
    color: #388e3c; /* Green color for play button */
}

/* View details button */
.slideshow-view-details {
    display: inline-block;
    padding: 8px 20px;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    margin-top: 10px;
    align-self: flex-start;
}

.slideshow-view-details:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .slideshow-slides {
        min-height: 700px; /* Taller for stacked layout */
    }

    .slideshow-slide {
        flex-direction: column;
        padding: 20px;
    }
    
    .slideshow-image-section {
        max-width: 100%;
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .slideshow-image-wrapper {
        padding-top: 50%; /* Maintain 2:1 aspect ratio */
    }
    
    .slideshow-content-section {
        max-width: 100%;
        padding: 15px;
        max-height: none;
    }
    
    .slideshow-title {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .slideshow-description {
        font-size: 14px;
        margin-bottom: 15px;
    }
}

@media (max-width: 768px) {
    .slideshow-slides {
        min-height: 600px;
    }
    
    .slideshow-nav {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .slideshow-prev {
        left: 10px;
    }
    
    .slideshow-next {
        right: 10px;
    }
    
    .slideshow-slide {
        padding: 10px;
    }
    
    .slideshow-image-section {
        padding: 10px;
    }
    
    .slideshow-content-section {
        padding: 10px;
    }
}

/* ================== 9. Lightbox Styles ================== */
.lightbox {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 999999;
    display: flex; 
    justify-content: center; 
    align-items: center; 
}
.lightbox-content {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 50%;
    min-width: 300px;
    position: relative;
    margin: 0 auto;
    max-height: 90vh;
    overflow-y: auto;
}
.lightbox img {
    width: 60%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.lightbox h2 {
    margin-bottom: 10px;
}
.lightbox p {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
}
p.lightbox-shortdesc {
    padding: 0 13% 10px;    
    font-size: 13px;
    color: #555;
    margin-bottom: 10px;
    font-weight: bold;
    line-height: 1.3;
}
.lightbox-close {
    position: absolute;
    top: 14px;
    right: 17px;
    font-size: 40px;
    cursor: pointer;
    color: #333;
}
.lightbox-close:hover {
    color: red;
    cursor: pointer;
}
.lightbox-longdesc {
    font-size: 13px;
    line-height: 1.3rem;
    background: #efefef;
    padding: 16px 60px 18px !important;
    margin: 0 -20px 20px;
    text-align: left;
    font-weight: 600;
    font-style: italic;
}
.lightbox-longtitle {
    display: none;  /* Also hidden until "More" is shown */
}
button.lightbox-morebtn {
    padding: 4px 20px;
    border-radius: 6px;
    border: 1px solid #999;
    box-shadow: 0 0 6px rgba(0,0,0,0.2);    
    float: right;
    margin-right: 32px;
}
button.lightbox-morebtn:hover {
    cursor: pointer;
    background: #887;
    color: white;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
}

/* Lightbox Nav Buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: black;
    cursor: pointer;
    background: #fff;
    padding: 10px;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none; /* Only shown if there are multiple artworks */
    height: 45px;
    width: 45px;
    border: 1px solid #dfdfdf;
}
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }
.preview-lightbox .lightbox-nav {
    padding: 16px 10px 10px;
    height: 27px;
    width: 33px;
}

/* Body class for when lightbox is visible - prevents scrolling */
body.lightbox-visible {
    overflow: hidden;
}

/* Additional Info Container */
.lightbox-additional-info {
    margin-top: 22px;
    display: none; /* Hidden until toggled */
}
.lightbox-descriptionheading {
    margin-top: 1em;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}

/* Container Wrappers for Additional Info */
.series-container,
.material-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    font-size: 13px;
}
.lightbox-seriesheading,
.lightbox-materialheading {
    font-size: 14px;
    font-weight: bold;
    text-align: left;
    margin-right: 7px;
}
.features-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin: 0;
    font-size: 14px;
    align-content: flex-start;
    flex-wrap: wrap;
}
.lightbox-featuresheading {
    font-size: 14px;
    font-weight: bold;
    text-align: left;
    margin-right: 7px;
}
ul.lightbox-features {
    list-style: none;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
}
ul.lightbox-features li {
    background: #7e7e7e;
    margin: 2px 4px;
    padding: 0 12px;
    font-size: 9px;
    border-radius: 9px;
    color: white;
    font-weight: 600;
}

/* Style-specific lightbox styles */
/* Style 2 Lightbox */
.lightbox.style-2 .lightbox-content {
    border: 1px solid #ddd;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Style 3 Lightbox */
.lightbox.style-3 .lightbox-content {
    background: #222;
    color: #fff;
}
.lightbox.style-3 h2, 
.lightbox.style-3 h3,
.lightbox.style-3 p {
    color: #fff;
}
.lightbox.style-3 p {
    color: #ddd;
}
.lightbox.style-3 p.lightbox-shortdesc {
    color: #ddd;
}
.lightbox.style-3 .lightbox-close {
    color: #fff;
}
.lightbox.style-3 .lightbox-longdesc {
    background: #444;
    color: #fff;
}
.lightbox.style-3 .lightbox-nav {
    background: #555;
    color: white;
    border-color: #777;
}
.lightbox.style-3 button.lightbox-morebtn {
    background: #555;
    color: #fff;
    border: 1px solid #777;
}
.lightbox.style-3 button.lightbox-morebtn:hover {
    background: #777;
}
.lightbox.style-3 ul.lightbox-features li {
    background: #555;
}

/* Style 4 Lightbox */
.lightbox.style-4 .lightbox-content {
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid #e0e0e0;
}
.lightbox.style-4 .lightbox-title {
    color: #604c3c;
    font-size: 20px;
    margin-bottom: 15px;
}
.lightbox.style-4 .lightbox-shortdesc {
    color: #555;
    font-weight: normal;
}
.lightbox.style-4 .lightbox-longdesc {
    background: #e9f0ff;
}
.lightbox.style-4 .lightbox-nav {
    background: white;
    color: #333;
    border: none;
}
.lightbox.style-4 button.lightbox-morebtn {
    background: #604c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    padding: 8px 16px;
}
.lightbox.style-4 button.lightbox-morebtn:hover {
    background: #4e3c2e;
}
.lightbox.style-4 ul.lightbox-features li {
    background: #2575fc;
}

/* Style 5 Lightbox */
.lightbox.style-5 .lightbox-content {
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
}
.lightbox.style-5 .lightbox-title {
    color: #333;
    font-size: 22px;
    margin-bottom: 15px;
}
.lightbox.style-5 .lightbox-nav {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.lightbox.style-5 button.lightbox-morebtn {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 16px;
}
.lightbox.style-5 button.lightbox-morebtn:hover {
    background: #ebebeb;
}

/* Style Indicator in Admin */
.style-indicator {
    background: #f7f7f7; 
    padding: 10px; 
    margin-bottom: 15px; 
    border-radius: 5px; 
    text-align: center;
}

/* ================== 10. Responsive Styles ================== */
@media only screen and (max-width: 1200px) {
    .card-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    }
}

@media only screen and (max-width: 768px) {
    .lightbox-content {
        width: 94%;
        margin: 0 auto;
    }
    .card-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    }
    .card-description {
        -webkit-line-clamp: 1; /* Show fewer lines on smaller screens */
    }
    .lightbox img {
        width: 80%;
    }
}

@media only screen and (max-width: 480px) {
    .card-container {
        grid-template-columns: 1fr !important; /* Single column on very small screens */
    }
    .lightbox-content {
        padding: 15px;
        width: 90%;
    }
    .lightbox-longdesc {
        padding: 10px 20px !important;
    }
    button.lightbox-morebtn {
        margin-right: 15px;
    }
    .lightbox-nav {
        height: 35px;
        width: 35px;
        font-size: 18px;
    }
    .lightbox img {
        width: 100%;
    }
}