/**
 * Smile Gallery Styles
 * Responsive video gallery with 9:16 aspect ratio cards
 */

/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
    --sg-ease-out-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --sg-ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --sg-duration-fast: 200ms;
    --sg-duration-normal: 300ms;
    --sg-duration-slow: 500ms;
    --sg-stagger-delay: 75ms;
    --sg-primary-color: #0088cc;
    --sg-primary-hover: #006da3;
    --sg-orange: #f7941d;
    --sg-orange-hover: #e8850a;
    --sg-text-color: #333;
    --sg-text-muted: #666;
    --sg-bg-light: #f5f5f5;
    --sg-border-color: #e0e0e0;
    --sg-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --sg-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --sg-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --sg-radius-sm: 8px;
    --sg-radius-md: 12px;
    --sg-radius-lg: 16px;
}

/* ========================================
   Archive Page - Gallery Grid
   ======================================== */
.smile-gallery-archive {
    padding: 0 20px 60px;
    max-width: 1400px;
    margin: 0 auto;
}

.smile-gallery-archive.smile-gallery-shortcode {
    padding: 0;
    max-width: none;
}

/* Elementor Header Zone */
.smile-gallery-header {
    margin-bottom: 40px;
}

/* Filter Bar */
.smile-gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
    justify-content: center;
}

.smile-gallery-filter-btn {
    padding: 12px 24px;
    border: 2px solid var(--sg-primary-color);
    border-radius: 50px;
    background: white;
    color: var(--sg-primary-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--sg-duration-normal) var(--sg-ease-out-smooth);
}

.smile-gallery-filter-btn:hover {
    background: var(--sg-primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

.smile-gallery-filter-btn.active {
    background: var(--sg-primary-color);
    border-color: var(--sg-primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

/* "More +" toggle */
.smile-gallery-filter-toggle {
    padding: 12px 24px;
    border: 2px dashed var(--sg-border-color);
    border-radius: 50px;
    background: white;
    color: var(--sg-text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--sg-duration-normal) var(--sg-ease-out-smooth);
}

.smile-gallery-filter-toggle:hover,
.smile-gallery-filter-toggle:focus,
.smile-gallery-filter-toggle:active {
    border-color: #999 !important;
    color: #333 !important;
    background: #f5f5f5 !important;
    -webkit-text-fill-color: #333 !important;
}

/* Hidden filters row */
.smile-gallery-filters-hidden {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 100%;
    padding-top: 10px;
}

/* Video Grid */
.smile-gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 600px) {
    .smile-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 992px) {
    .smile-gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
}

/* Video Card */
.smile-gallery-card {
    position: relative;
    border-radius: var(--sg-radius-md);
    overflow: hidden;
    background: var(--sg-bg-light);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--sg-duration-slow) var(--sg-ease-out-smooth),
                transform var(--sg-duration-slow) var(--sg-ease-out-smooth);
}

.smile-gallery-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.smile-gallery-card.is-hidden {
    display: none;
}

.smile-gallery-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* 9:16 Aspect Ratio Container */
.smile-gallery-card-thumbnail {
    position: relative;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: #1a1a1a;
}

.smile-gallery-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--sg-duration-normal) var(--sg-ease-out-smooth);
}

.smile-gallery-card:hover .smile-gallery-card-thumbnail img {
    transform: scale(1.05);
}

/* Play Button Overlay - Hidden on archive, shown on related videos */
.smile-gallery-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity var(--sg-duration-normal) var(--sg-ease-out-smooth);
}

/* Hide play overlay on card grids — cards link to a detail page, not direct playback */
.smile-gallery-archive .smile-gallery-play-overlay,
.smile-gallery-shortcode .smile-gallery-play-overlay,
.smile-gallery-related .smile-gallery-play-overlay {
    display: none;
}

.smile-gallery-play-icon {
    width: 48px;
    height: 48px;
    background: var(--sg-primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transform: scale(0.85);
    transition: transform var(--sg-duration-normal) var(--sg-ease-out-back),
                background var(--sg-duration-normal);
}

.smile-gallery-related .smile-gallery-card:hover .smile-gallery-play-icon {
    transform: scale(1);
    background: var(--sg-primary-hover);
}

.smile-gallery-play-icon svg {
    width: 22px;
    height: 22px;
    margin-left: 3px;
    fill: #fff;
}

/* Card Info - Overlay Style */
.smile-gallery-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 50px 10px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
    z-index: 2;
}

/* "Watch" affordance — shows the card is clickable */
.smile-gallery-card-info::after {
    content: "Watch";
    display: inline-block;
    margin-top: 10px;
    padding-right: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'><line x1='5' y1='12' x2='19' y2='12'/><polyline points='12 5 19 12 12 19'/></svg>");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 14px 14px;
    transition: padding-right var(--sg-duration-normal) var(--sg-ease-out-smooth);
}

.smile-gallery-card:hover .smile-gallery-card-info::after {
    padding-right: 24px;
}

.smile-gallery-card .smile-gallery-card-title,
.smile-gallery-card h3.smile-gallery-card-title,
h3.smile-gallery-card-title,
.smile-gallery-card-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    color: #ffffff !important;
    line-height: 1.35 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    background: none !important;
    -webkit-text-fill-color: #ffffff !important;
}

.smile-gallery-card-procedures {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 52px;
    overflow: hidden;
}

.smile-gallery-card-procedure {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.25);
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: capitalize;
    backdrop-filter: blur(4px);
}

/* Load More Button */
.smile-gallery-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.smile-gallery-load-more-btn {
    padding: 14px 48px;
    border: 2px solid var(--sg-primary-color);
    border-radius: 50px;
    background: white;
    color: var(--sg-primary-color);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--sg-duration-normal) var(--sg-ease-out-smooth);
}

.smile-gallery-load-more-btn:hover {
    background: var(--sg-primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

.smile-gallery-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Pagination */
.smile-gallery-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 50px;
}

.smile-gallery-pagination a,
.smile-gallery-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    border-radius: var(--sg-radius-sm);
    background: white;
    border: 1px solid var(--sg-border-color);
    color: var(--sg-text-color);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--sg-duration-fast) var(--sg-ease-out-smooth);
}

.smile-gallery-pagination a:hover {
    border-color: var(--sg-primary-color);
    color: var(--sg-primary-color);
}

.smile-gallery-pagination .current {
    background: var(--sg-primary-color);
    border-color: var(--sg-primary-color);
    color: white;
}

/* ========================================
   Single Video Page
   ======================================== */
.smile-gallery-single {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 60px;
}

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

/* Hero Grid - Two Column Layout */
.smile-gallery-hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 60px;
    align-items: start;
}

@media (min-width: 768px) {
    .smile-gallery-hero-grid {
        grid-template-columns: minmax(300px, 400px) 1fr;
        gap: 40px;
    }
}

@media (min-width: 1024px) {
    .smile-gallery-hero-grid {
        grid-template-columns: 380px 1fr;
        gap: 40px;
    }
}

/* Left Column - Video */
.smile-gallery-video-column {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    animation: sgFadeInUp 0.6s ease-out forwards;
}

@media (min-width: 768px) {
    .smile-gallery-video-column {
        max-width: none;
        margin: 0;
        position: sticky;
        top: 100px;
    }
}

.smile-gallery-video-wrapper {
    position: relative;
    aspect-ratio: 9 / 16;
    background: #1a1a1a;
    border-radius: var(--sg-radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.smile-gallery-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Right Column - Info */
.smile-gallery-info-column {
    animation: sgFadeInUp 0.6s ease-out 0.15s both;
}

/* Title & Badge */
.smile-gallery-title-wrap {
    margin-bottom: 24px;
}

/* Multiple badges container */
.smile-gallery-procedure-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.smile-gallery-single .smile-gallery-procedure-badge,
.smile-gallery-procedure-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--sg-primary-color) !important;
    background: rgba(0, 136, 204, 0.1) !important;
    padding: 6px 16px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.smile-gallery-single .smile-gallery-single-title,
.smile-gallery-single h1.smile-gallery-single-title,
h1.smile-gallery-single-title {
    font-size: clamp(28px, 5vw, 42px) !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: #222 !important;
    line-height: 1.15 !important;
    background: none !important;
    -webkit-text-fill-color: #222 !important;
}

/* Description */
.smile-gallery-single .smile-gallery-description,
.smile-gallery-description {
    margin-bottom: 28px;
    color: #555 !important;
    font-size: 16px;
    line-height: 1.7;
}

.smile-gallery-description p {
    margin: 0 0 16px;
    color: #555 !important;
}

.smile-gallery-description p:last-child {
    margin-bottom: 0;
}

/* Procedure Details */
.smile-gallery-details {
    margin-bottom: 32px;
}

.smile-gallery-detail-full {
    background: none;
    padding: 0;
    margin-bottom: 24px;
}

.smile-gallery-detail-full .smile-gallery-detail-label {
    font-family: "Open Sans", Sans-serif !important;
    font-size: 1.3em !important;
    font-weight: 400 !important;
    text-transform: uppercase;
    letter-spacing: normal !important;
    color: #276092 !important;
    -webkit-text-fill-color: #276092 !important;
    margin-bottom: 16px;
}

.smile-gallery-detail-full .smile-gallery-detail-value {
    font-family: "Open Sans", Sans-serif !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    line-height: 1.6;
    letter-spacing: 0px;
    color: #333 !important;
    -webkit-text-fill-color: #333 !important;
}

.smile-gallery-detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.smile-gallery-detail-row .smile-gallery-detail-item {
    flex: 0 0 auto;
    min-width: auto;
    background: none;
    padding: 0;
    padding-right: 30px;
    border-right: 1px solid var(--sg-border-color);
}

.smile-gallery-detail-row .smile-gallery-detail-item:last-child {
    border-right: none;
    padding-right: 0;
}

.smile-gallery-single .smile-gallery-detail-row .smile-gallery-detail-label,
.smile-gallery-detail-row .smile-gallery-detail-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999 !important;
    margin-bottom: 6px;
    -webkit-text-fill-color: #999 !important;
}

.smile-gallery-single .smile-gallery-detail-row .smile-gallery-detail-value,
.smile-gallery-detail-row .smile-gallery-detail-value {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #333 !important;
    line-height: 1.3;
    -webkit-text-fill-color: #333 !important;
}

/* Inline CTA */
.smile-gallery-cta-inline {
    margin-top: 32px;
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

@media (max-width: 400px) {
    .smile-gallery-cta-inline {
        flex-direction: column;
        align-items: flex-start;
    }

    .smile-gallery-cta-or {
        margin: 8px 0 !important;
    }
}

.smile-gallery-cta-inline .smile-gallery-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px 14px 24px;
    background-color: #FFAC0C !important;
    color: #fff !important;
    font-family: "Open Sans", sans-serif;
    font-size: 0.9em;
    font-weight: 400;
    letter-spacing: 0.4px;
    text-decoration: none !important;
    border-radius: 34px;
    border: none !important;
    box-shadow: none;
    transition: all 0.3s ease;
    -webkit-text-fill-color: #fff !important;
}

.smile-gallery-cta-inline .smile-gallery-cta-btn:hover {
    background-color: #7aba57 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    box-shadow: none;
    transform: none;
}

.smile-gallery-cta-inline .smile-gallery-cta-btn svg {
    stroke: #fff;
    width: 24px;
    height: 24px;
}

.smile-gallery-cta-or {
    margin: 0 16px;
    font-size: 14px;
    font-weight: 700;
    color: #555;
}

.smile-gallery-cta-inline a.smile-gallery-cta-phone,
.smile-gallery-cta-inline a.smile-gallery-cta-phone:visited {
    font-family: Roboto, sans-serif;
    font-size: 20px;
    font-weight: 500;
    line-height: 30px;
    color: rgb(0, 140, 205) !important;
    -webkit-text-fill-color: unset !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

.smile-gallery-cta-inline a.smile-gallery-cta-phone:hover,
.smile-gallery-cta-inline a.smile-gallery-cta-phone:focus {
    color: #FFAC0C !important;
    -webkit-text-fill-color: unset !important;
    text-decoration: none !important;
}

/* Legacy CTA Section (for full-width if needed) */
.smile-gallery-cta {
    text-align: center;
    padding: 50px 30px;
    background: linear-gradient(135deg, #0088cc 0%, #006699 100%);
    border-radius: var(--sg-radius-lg);
    margin: 40px 0;
    box-shadow: 0 10px 40px rgba(0, 119, 182, 0.3);
}

.smile-gallery-cta-title {
    font-size: clamp(22px, 4vw, 30px);
    font-weight: 700;
    color: white;
    margin: 0 0 20px;
}

.smile-gallery-cta-btn {
    display: inline-block;
    padding: 16px 40px;
    background: white;
    color: var(--sg-primary-color);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: var(--sg-shadow-md);
    transition: all var(--sg-duration-normal) var(--sg-ease-out-smooth);
}

.smile-gallery-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--sg-shadow-lg);
    color: var(--sg-primary-hover);
}

/* Divider */
.smile-gallery-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 40px 0;
}

/* Related Videos */
.smile-gallery-related {
    margin-bottom: 50px;
    padding-top: 0;
}

.smile-gallery-single .smile-gallery-related-title,
.smile-gallery-related-title {
    font-size: 28px !important;
    font-weight: 700 !important;
    margin-bottom: 30px !important;
    color: #222 !important;
    text-align: center;
    -webkit-text-fill-color: #222 !important;
    background: none !important;
}

.smile-gallery-related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 768px) {
    .smile-gallery-related-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* Back Link */
.smile-gallery-back {
    text-align: center;
    padding: 15px 0 0;
    margin-bottom: 0;
}

.smile-gallery-back a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--sg-primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    padding: 12px 24px;
    border: 2px solid var(--sg-primary-color);
    border-radius: 50px;
    transition: all var(--sg-duration-normal);
}

.smile-gallery-back a:hover {
    background: var(--sg-primary-color);
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

.smile-gallery-back svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   Loading States
   ======================================== */
.smile-gallery-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: sgSkeleton 1.5s ease-in-out infinite;
}

@keyframes sgSkeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   Reduced Motion Support
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .smile-gallery-card {
        opacity: 1;
        transform: none;
    }

    .smile-gallery-hero,
    .smile-gallery-title-wrap,
    .smile-gallery-content-section,
    .smile-gallery-cta {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

/* ========================================
   No Results State
   ======================================== */
.smile-gallery-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--sg-text-muted);
}

.smile-gallery-no-results h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--sg-text-color);
}

/* ========================================
   Placeholder Thumbnail
   ======================================== */
.smile-gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
}

.smile-gallery-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
}
