/* Grand Theaters Frontend Styles */

/* Movie Grid */
.gt-movies-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

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

/* Clickable movie card links */
a.gt-movie-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

a.gt-movie-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.gt-movie-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.gt-movie-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.gt-movie-poster {
    position: relative;
    overflow: hidden;
    aspect-ratio: 2/3;
    background: #1a1a2e;
}

.gt-movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gt-no-poster {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
    text-align: center;
    padding: 20px;
    background: #f0f0f0;
}

.gt-movie-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.gt-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.gt-badge-coming-soon {
    background: #f0ad4e;
    color: #fff;
}

.gt-movie-info {
    padding: 12px 15px;
}

.gt-movie-title {
    margin: 0 0 5px;
    font-size: 16px;
    line-height: 1.3;
}

.gt-movie-genre,
.gt-movie-runtime,
.gt-movie-release {
    margin: 0;
    color: #666;
    font-size: 13px;
}

/* Movie Detail */
.gt-movie-detail {
    margin: 20px 0;
}

.gt-movie-detail[style*="--gt-bg-image"] {
    position: relative;
}

.gt-movie-detail[style*="--gt-bg-image"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 300px;
    background: var(--gt-bg-image) center/cover no-repeat;
    opacity: 0.15;
    z-index: 0;
}

.gt-movie-detail-header {
    display: flex;
    gap: 30px;
    position: relative;
    z-index: 1;
    margin-bottom: 30px;
}

.gt-movie-detail-poster {
    flex-shrink: 0;
    width: 300px;
}

.gt-movie-detail-poster img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.gt-movie-detail-info {
    flex: 1;
}

.gt-movie-detail-title {
    margin: 0 0 15px;
    font-size: 28px;
}

.gt-movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.gt-meta-item {
    display: inline-block;
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 13px;
}

.gt-rated {
    background: #333;
    color: #fff;
    font-weight: 700;
}

.gt-movie-plot {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #444;
}

.gt-movie-director,
.gt-movie-cast {
    margin: 5px 0;
    line-height: 1.6;
    color: #444;
}

.gt-movie-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.gt-feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #e8f4fd;
    border: 1px solid #b3d9f2;
    border-radius: 20px;
    font-size: 12px;
    color: #0c5460;
}

.gt-feature-badge .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Media Row (trailers + photos combined) */
.gt-movie-media-row {
    margin: 30px 0;
}

.gt-movie-media-row > h3 {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.gt-movie-media-row > h3::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ccc;
}

.gt-media-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    align-items: stretch;
}

.gt-media-grid .gt-media-item {
    flex: 0 0 auto !important;
    position: relative;
    display: block !important;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    height: 180px;
}

.gt-media-grid .gt-media-item img {
    height: 180px !important;
    width: auto !important;
    max-width: none !important;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

.gt-media-grid .gt-media-item:hover img {
    opacity: 0.8;
}

/* Play button overlay for trailers */
.gt-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    padding-left: 3px;
    transition: background 0.2s, transform 0.2s;
    pointer-events: none;
}

.gt-media-trailer:hover .gt-play-overlay {
    background: rgba(255, 0, 0, 0.85);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Lightbox */
.gt-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.gt-lightbox-overlay.active {
    display: flex;
}

.gt-lightbox-img {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    cursor: default;
}

.gt-lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #fff;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    z-index: 1000000;
    opacity: 0.8;
    transition: opacity 0.2s;
    background: none;
    border: none;
    padding: 0;
}

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

.gt-lightbox-prev,
.gt-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 48px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    z-index: 1000000;
    opacity: 0.7;
    transition: opacity 0.2s;
    background: none;
    border: none;
    padding: 10px;
    user-select: none;
}

.gt-lightbox-prev { left: 15px; }
.gt-lightbox-next { right: 15px; }

.gt-lightbox-prev:hover,
.gt-lightbox-next:hover {
    opacity: 1;
}

.gt-lightbox-video {
    display: none;
    width: 80%;
    max-width: 900px;
    aspect-ratio: 16/9;
    cursor: default;
}

.gt-lightbox-video iframe {
    width: 100%;
    height: 100%;
    border-radius: 6px;
}

.gt-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #ccc;
    font-size: 14px;
}

/* Showtimes */
.gt-movie-showtimes,
.gt-showtimes-widget {
    margin: 20px 0;
}

.gt-movie-showtimes > h3 {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.gt-movie-showtimes > h3::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ccc;
}

.gt-showtime-day {
    margin-bottom: 25px;
}

.gt-showtimes-day {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.gt-showtime-date,
.gt-showtimes-day-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: #222;
}

/* Showtime cards grid — one card per theater per day */
.gt-showtime-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.gt-showtime-card {
    background: #e8e8e8;
    border-radius: 8px;
    padding: 15px 18px;
    min-width: 200px;
    flex: 0 1 auto;
}

/* Optional labels at top of card (e.g. "Early Showings!", "3D") */
.gt-showtime-labels {
    margin-bottom: 6px;
}

.gt-showtime-label {
    display: inline-block;
    font-style: italic;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-right: 8px;
}

.gt-showtime-theater-name {
    font-weight: 700;
    font-size: 15px;
    color: #111;
    margin-bottom: 4px;
}

.gt-showtime-theater-features {
    margin-bottom: 4px;
}

.gt-showtime-feature {
    display: block;
    font-size: 13px;
    font-style: italic;
    color: #444;
    line-height: 1.4;
}

a.gt-showtime-feature {
    color: #0073aa;
    text-decoration: none;
}

a.gt-showtime-feature:hover {
    color: #005a87;
    text-decoration: underline;
}

a.gt-feature-badge {
    text-decoration: none;
}

a.gt-feature-badge:hover {
    text-decoration: underline;
}

.gt-showtime-theater-notes {
    font-size: 12px;
    color: #666;
    font-style: italic;
    margin-bottom: 6px;
}

.gt-showtime-times,
.gt-showtimes-times {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.gt-showtime-time,
.gt-chip-time {
    font-weight: 700;
    font-size: 14px;
    color: #333;
}

a.gt-buy-ticket,
a.gt-chip-time {
    color: #0073aa;
    text-decoration: none;
    border-bottom: 1px dashed #0073aa;
}

a.gt-buy-ticket:hover,
a.gt-chip-time:hover {
    color: #005a87;
}

.gt-showtime-entry,
.gt-showtime-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 14px;
}

.gt-showtime-theater,
.gt-chip-theater {
    font-weight: 600;
    color: #555;
    font-size: 12px;
}

.gt-showtimes-movie-name {
    margin: 0 0 8px;
    font-size: 15px;
}

.gt-showtimes-movie-row {
    margin-bottom: 12px;
}

/* Theaters List */
.gt-theaters-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.gt-theater-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gt-theater-name {
    margin: 0 0 8px;
    font-size: 18px;
}

.gt-theater-capacity {
    color: #666;
    font-size: 14px;
    margin: 0 0 10px;
}

.gt-theater-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.gt-theater-notes {
    color: #666;
    font-size: 13px;
    font-style: italic;
}

/* Frontend Calendar */
.gt-frontend-calendar {
    margin: 20px 0;
}

.gt-cal-front-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.gt-cal-front-nav {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 16px;
}

.gt-cal-front-nav:hover {
    background: #f0f0f0;
}

.gt-cal-front-title {
    font-size: 20px;
    font-weight: 700;
}

.gt-cal-front-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.gt-cal-front-header {
    padding: 10px;
    text-align: center;
    font-weight: 700;
    background: #f7f7f7;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.gt-cal-front-cell {
    min-height: 80px;
    padding: 6px;
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
}

.gt-cal-front-cell.other-month {
    background: #fafafa;
    color: #ccc;
}

.gt-cal-front-cell.today {
    background: #f0f7ff;
}

.gt-cal-front-day {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
}

.gt-cal-front-event {
    display: block;
    padding: 2px 5px;
    margin-bottom: 2px;
    background: #0073aa;
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gt-cal-front-event:hover {
    opacity: 0.85;
    color: #fff;
}

/* No results */
.gt-no-movies,
.gt-no-showtimes,
.gt-not-found {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .gt-columns-3,
    .gt-columns-4,
    .gt-columns-5 {
        grid-template-columns: repeat(2, 1fr);
    }

    .gt-movie-detail-header {
        flex-direction: column;
        align-items: center;
    }

    .gt-movie-detail-poster {
        width: 90%;
        max-width: 350px;
    }

    .gt-movie-detail-title {
        text-align: center;
        font-size: 22px;
    }

    .gt-media-grid .gt-media-item {
        height: 140px;
    }

    .gt-media-grid .gt-media-item img {
        height: 140px !important;
    }

    .gt-lightbox-video {
        width: 95%;
    }

    .gt-theaters-list {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 480px) {
    .gt-columns-2,
    .gt-columns-3,
    .gt-columns-4,
    .gt-columns-5 {
        grid-template-columns: repeat(2, 1fr);
    }

    .gt-cal-front-grid {
        font-size: 12px;
    }
}

/* ===== Weekly Schedule ===== */
.gt-weekly-schedule {
    margin: 20px 0;
}

/* Toolbar — dark-friendly */
.gt-ws-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.gt-ws-nav {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #fff;
    transition: background 0.2s;
}

.gt-ws-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gt-ws-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

/* Scroll container — only horizontal overflow so sticky top works */
.gt-ws-scroll-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #333;
    border-radius: 8px;
}

/* Grid */
.gt-ws-grid {
    display: grid;
    grid-template-columns: 220px repeat(var(--gt-ws-cols, 7), minmax(130px, 1fr));
    min-width: max-content;
}

.gt-ws-header-row,
.gt-ws-movie-row {
    display: contents;
}

/* Corner cell (top-left, sticky both ways) */
.gt-ws-corner {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 15;
    background: #1a1a1a;
    border-bottom: 2px solid #444;
    border-right: 1px solid #333;
    padding: 12px 8px;
}

/* Date headers — sticky top */
.gt-ws-date-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #1a1a1a;
    border-bottom: 2px solid #444;
    border-right: 1px solid #333;
    padding: 12px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.gt-ws-date-header.gt-ws-today {
    background: #1a2a3a;
}

.gt-ws-day-name {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.gt-ws-day-date {
    font-size: 12px;
    color: #aaa;
}

/* Movie cell — sticky left, dark bg */
.gt-ws-movie-cell {
    position: sticky;
    left: 0;
    z-index: 5;
    background: #111;
    border-right: 1px solid #333;
    border-bottom: 1px solid #222;
    padding: 10px;
    min-width: 220px;
}

.gt-ws-movie-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.gt-ws-movie-link:hover {
    text-decoration: none;
    color: inherit;
}

.gt-ws-poster {
    width: 60px;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.gt-ws-no-poster {
    width: 60px;
    height: 90px;
    background: #222;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #666;
    text-align: center;
    flex-shrink: 0;
}

.gt-ws-movie-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.gt-ws-movie-title {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    line-height: 1.3;
}

.gt-ws-movie-meta {
    font-size: 11px;
    color: #999;
}

/* Time cells — dark alternating for readability */
.gt-ws-time-cell {
    padding: 10px 8px;
    border-bottom: 1px solid #222;
    border-right: 1px solid #222;
    background: #161616;
    vertical-align: top;
}

.gt-ws-time-cell.gt-ws-today {
    background: #1a2233;
}

.gt-ws-theater-group {
    margin-bottom: 6px;
}

.gt-ws-theater-group:last-child {
    margin-bottom: 0;
}

.gt-ws-theater-name {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    margin-bottom: 3px;
}

.gt-ws-times {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

a.gt-ws-time-link {
    display: inline-block;
    padding: 3px 8px;
    background: #0073aa;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

a.gt-ws-time-link:hover {
    background: #0099dd;
    color: #fff;
}

.gt-ws-time {
    display: inline-block;
    padding: 3px 8px;
    background: #2a2a2a;
    color: #ccc;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.gt-ws-no-times {
    color: #444;
    font-size: 14px;
}

.gt-ws-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* JS-driven sticky header bar (fixed clone) */
.gt-ws-sticky-bar {
    display: flex;
    background: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.gt-ws-sticky-bar .gt-ws-corner,
.gt-ws-sticky-bar .gt-ws-date-header {
    position: static;
    flex-shrink: 0;
}

.gt-weekly-schedule.gt-ws-loading .gt-ws-scroll-container {
    opacity: 0.5;
    pointer-events: none;
}

@media screen and (max-width: 768px) {
    .gt-ws-grid {
        grid-template-columns: 160px repeat(var(--gt-ws-cols, 7), minmax(110px, 1fr));
    }

    .gt-ws-movie-cell {
        min-width: 160px;
        padding: 8px;
    }

    .gt-ws-poster {
        width: 45px;
        height: 67px;
    }

    .gt-ws-no-poster {
        width: 45px;
        height: 67px;
    }

    .gt-ws-movie-title {
        font-size: 12px;
    }

    .gt-ws-movie-meta {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .gt-ws-grid {
        grid-template-columns: 120px repeat(var(--gt-ws-cols, 7), minmax(100px, 1fr));
    }

    .gt-ws-movie-cell {
        min-width: 120px;
    }

    .gt-ws-poster {
        width: 35px;
        height: 52px;
    }

    .gt-ws-no-poster {
        width: 35px;
        height: 52px;
    }
}
