/* 
 * Kueue / Kontentainment Elementor Widgets CSS
 * Premium, Light-mode only, Editorial Design
 */

:root {
    --ktn-primary: #121212;
    --ktn-secondary: #f2f2f2;
    --ktn-surface: #ffffff;
    --ktn-border: rgba(0, 0, 0, 0.08);
    --ktn-text-main: #2a2a2a;
    --ktn-text-muted: #6b6b6b;
    --ktn-radius-lg: 16px;
    --ktn-radius-md: 12px;
    --ktn-radius-sm: 8px;
    --ktn-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --ktn-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --ktn-shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Global Grid System */
.ktn-elementor-grid {
    display: grid;
    gap: 24px;
    width: 100%;
}

/* Base Card Styles */
.ktn-elem-movie-card,
.ktn-elem-cinema-card,
.ktn-elem-area-card {
    background: var(--ktn-surface);
    border-radius: var(--ktn-radius-lg);
    overflow: hidden;
    position: relative;
    transition: var(--ktn-transition);
    display: flex;
    flex-direction: column;
}

/* Movies Widget Skins */
.ktn-skin-grid_1 .ktn-elem-movie-card {
    border: none;
}
.ktn-skin-grid_2 .ktn-elem-movie-card {
    border: 1px solid var(--ktn-border);
}
.ktn-skin-grid_1 .ktn-elem-movie-card:hover,
.ktn-skin-grid_2 .ktn-elem-movie-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ktn-shadow-hover);
}

.ktn-skin-list .ktn-elementor-grid {
    grid-template-columns: 1fr !important;
}
.ktn-skin-list .ktn-elem-movie-card,
.ktn-skin-list .ktn-elem-cinema-card {
    flex-direction: row;
    align-items: center;
    border: 1px solid var(--ktn-border);
}
.ktn-skin-list .ktn-elem-poster,
.ktn-skin-list .ktn-elem-cinema-logo {
    width: 120px;
    height: 100%;
    flex-shrink: 0;
}
@media(max-width: 768px) {
    .ktn-skin-list .ktn-elem-movie-card,
    .ktn-skin-list .ktn-elem-cinema-card {
        flex-direction: column;
    }
    .ktn-skin-list .ktn-elem-poster,
    .ktn-skin-list .ktn-elem-cinema-logo {
        width: 100%;
        height: auto;
    }
}

.ktn-elem-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--ktn-secondary);
    border-radius: var(--ktn-radius-md);
}
.ktn-elem-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--ktn-transition);
}
.ktn-elem-movie-card:hover .ktn-elem-poster img {
    transform: scale(1.05);
}

.ktn-elem-no-poster, .ktn-no-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--ktn-text-muted);
    font-size: 0.9em;
}

.ktn-elem-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    color: var(--ktn-primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ktn-badge-area {
    top: auto;
    bottom: 12px;
    right: auto;
    left: 12px;
    background: var(--ktn-primary);
    color: #fff;
}

.ktn-elem-content {
    padding: 16px 4px 0 4px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.ktn-elem-title {
    margin: 0 0 4px 0;
    font-size: 1.1em;
    font-weight: 700;
    color: var(--ktn-text-main);
    line-height: 1.3;
}
.ktn-elem-title a {
    color: inherit;
    text-decoration: none;
}
.ktn-elem-title a:hover {
    color: var(--ktn-text-muted);
}

.ktn-elem-meta {
    font-size: 0.85em;
    color: var(--ktn-text-muted);
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.ktn-meta-genre {
    color: var(--ktn-primary);
    font-weight: 500;
}

.ktn-elem-excerpt {
    font-size: 0.9em;
    color: var(--ktn-text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

.ktn-elem-actions {
    margin-top: auto;
}
.ktn-btn-primary {
    display: inline-block;
    width: 100%;
    text-align: center;
    background: var(--ktn-secondary);
    color: var(--ktn-primary);
    padding: 10px 16px;
    border-radius: var(--ktn-radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: var(--ktn-transition);
}
.ktn-btn-primary:hover {
    background: var(--ktn-primary);
    color: var(--ktn-surface);
}

.ktn-btn-secondary {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--ktn-border);
    color: var(--ktn-text-main);
    text-decoration: none;
    border-radius: var(--ktn-radius-sm);
    font-weight: 500;
    transition: var(--ktn-transition);
}
.ktn-btn-secondary:hover {
    border-color: var(--ktn-primary);
    color: var(--ktn-primary);
}

/* Cinemas Specific */
.ktn-elem-cinema-logo {
    width: 100%;
    aspect-ratio: 16/9;
    background: #fdfdfd;
    border-bottom: 1px solid var(--ktn-border);
}
.ktn-elem-cinema-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 24px;
}
.ktn-elem-cinema-info {
    padding: 20px;
}
.ktn-elem-cinema-info h3 {
    margin: 0 0 8px 0;
    font-size: 1.2em;
}

/* Areas Widget */
.ktn-elem-area-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border: 1px solid var(--ktn-border);
    text-decoration: none;
    color: var(--ktn-text-main);
}
.ktn-elem-area-card:hover {
    background: var(--ktn-secondary);
    border-color: transparent;
}
.ktn-area-title {
    margin: 0;
    font-size: 1.1em;
}
.ktn-area-count {
    display: block;
    font-size: 0.85em;
    color: var(--ktn-text-muted);
    margin-top: 4px;
}
.ktn-area-desc {
    margin: 8px 0 0 0;
    font-size: 0.9em;
    color: var(--ktn-text-muted);
}
.ktn-area-arrow {
    color: var(--ktn-border);
    transition: var(--ktn-transition);
}
.ktn-elem-area-card:hover .ktn-area-arrow {
    color: var(--ktn-primary);
    transform: translateX(4px);
}

/* Single Movie/Cinema Widgets */
.ktn-hero {
    position: relative;
    border-radius: var(--ktn-radius-lg);
    overflow: hidden;
    background: var(--ktn-secondary);
    margin-bottom: 24px;
}
.ktn-hero-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.2;
    filter: blur(8px);
}
.ktn-hero-content {
    position: relative;
    z-index: 10;
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 32px;
}
.ktn-hero-poster {
    width: 140px;
    flex-shrink: 0;
    border-radius: var(--ktn-radius-md);
    overflow: hidden;
    box-shadow: var(--ktn-shadow);
}
.ktn-hero-poster img {
    width: 100%;
    display: block;
}
.ktn-hero-title {
    font-size: 2.5em;
    margin: 0;
    font-weight: 800;
}

.ktn-cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
}
.ktn-cast-card {
    text-align: center;
}
.ktn-cast-img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 1px solid var(--ktn-border);
}
.ktn-cast-name {
    display: block;
    font-weight: 600;
    font-size: 0.85em;
}
.ktn-cast-role {
    display: block;
    font-size: 0.75em;
    color: var(--ktn-text-muted);
}

.ktn-info-panel-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}
.ktn-info-panel-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--ktn-border);
    font-size: 0.95em;
    display: flex;
    justify-content: space-between;
}
.ktn-info-panel-list li:last-child {
    border-bottom: none;
}

.ktn-stats-box {
    background: var(--ktn-secondary);
    padding: 32px;
    border-radius: var(--ktn-radius-md);
    text-align: center;
}
.ktn-stats-number {
    display: block;
    font-size: 3em;
    font-weight: 800;
    color: var(--ktn-primary);
}
.ktn-stats-label {
    display: block;
    font-size: 1em;
    color: var(--ktn-text-muted);
    font-weight: 500;
}

/* Showtimes Embedded overrides */
.ktn-elementor-showtimes-wrapper .ktn-modern-date-switcher {
    margin-bottom: 24px;
}
.ktn-elem-showtime-block {
    background: var(--ktn-surface);
    border: 1px solid var(--ktn-border);
    border-radius: var(--ktn-radius-md);
    padding: 24px;
    margin-bottom: 16px;
}
.ktn-elem-group-title {
    margin: 0 0 16px 0;
    font-size: 1.25em;
    font-weight: 600;
}
.ktn-elem-group-title a {
    color: inherit;
    text-decoration: none;
}
.ktn-elem-chips-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* KTN Movies Mobile Slider Widget (OTT Style) */
.ktn-mobile-slider-wrapper {
    width: 100%;
    position: relative;
    padding: 10px 0;
    min-height: 200px; /* Safety height */
}

.ktn-mobile-swiper.swiper {
    width: 100%;
    padding: 10px 0 20px;
    overflow: visible; /* Allows for partial visible slides overlap */
}

.ktn-premium-poster-card {
    background: #1a1a1a; /* Fallback background */
    overflow: hidden;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 100%;
    aspect-ratio: 2/3; /* CRITICAL: Enforce card height */
    -webkit-tap-highlight-color: transparent;
}

.ktn-premium-poster-card:active {
    transform: scale(0.96);
}

.ktn-mobile-card-link {
    display: block;
    text-decoration: none;
    color: #fff;
    width: 100%;
    height: 100%;
}

.ktn-mobile-card-poster {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: block;
    background-size: cover;
    background-position: center;
}

.ktn-mobile-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: translateZ(0);
}

/* Gradient Overlay */
.ktn-mobile-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0; /* Full coverage for consistent gradient */
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    pointer-events: none;
    transition: background 0.3s ease;
    z-index: 2;
}

.ktn-mobile-card-title {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    margin: 0;
    font-size: 1.1em;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
    text-shadow: 0 2px 6px rgba(0,0,0,1);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center; /* Default fallback */
    z-index: 3;
}

/* Visibility Logic: Desktop/Tablet */
@media (min-width: 1025px) {
    .elementor-widget-ktn-movies-mobile-widget {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .elementor-widget-ktn-movies-mobile-widget {
        display: none !important;
    }
}

/* Mobile Display */
@media (max-width: 767px) {
    .elementor-widget-ktn-movies-mobile-widget {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}
