/* ==========================================================================
   CentralKino Buchung - Plugin Styles
   ========================================================================== */

/* --- Frontend Shift Board (Shortcode: [cinema_shift_board]) --- */

:root {
    --ckb-border: #e0e0e0;
    --ckb-bg-subtle: #f6f6f6;
    --ckb-text: #333333;
    --ckb-text-muted: #767676;
    --ckb-taken: #4f7a5c;
    --ckb-open: #a8574a;
    --ckb-claim: #2f6690;
    --ckb-claim-hover: #244f70;
    --ckb-leave: #8a3d38;
    --ckb-leave-hover: #6e302c;
}

.ckb-shift-board {
    width: 100%;
    max-width: none;
    margin: 0;
}

.ckb-shift-board-heading {
    font-size: 1.15em;
    font-weight: 600;
    margin: 0 0 12px;
}

.ckb-shift-board-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.ckb-shift-board-month {
    font-size: 1.05em;
    font-weight: 700;
    text-transform: capitalize;
    color: var(--ckb-text);
    text-align: center;
    flex: 1 1 auto;
}

.ckb-nav-today {
    font-size: 0.75em;
    font-weight: 500;
    margin-left: 6px;
    color: var(--ckb-taken);
}

.ckb-nav-btn {
    color: #fff;
    border: none;
    padding: 6px 12px;
    font-size: 0.82em;
    border-radius: 3px;
    white-space: nowrap;
    transition: background 0.2s ease;
    background-color: var(--ckb-claim);
    text-decoration: none;
    display: inline-block;
    flex: 0 0 auto;
}
.ckb-nav-btn:hover {
    background-color: var(--ckb-claim-hover);
    color: #fff;
}

@media (max-width: 500px) {
    .ckb-shift-board-nav {
        flex-direction: column;
    }
    .ckb-shift-board-month {
        order: -1;
    }
}

.ckb-shift-card {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    border: 1px solid var(--ckb-border);
    border-radius: 4px;
    padding: 10px 14px;
    margin-bottom: 8px;
    background: #fff;
}

.ckb-shift-info {
    flex: 0 0 230px;
    min-width: 200px;
}

.ckb-shift-time {
    font-size: 0.82em;
    font-weight: 600;
    color: var(--ckb-text-muted);
}

.ckb-movie-title {
    font-size: 1em;
    font-weight: 600;
    color: var(--ckb-text);
    margin-top: 2px;
}

.ckb-shift-roles {
    display: flex;
    flex: 1 1 auto;
    gap: 10px;
    flex-wrap: wrap;
}

.ckb-shift-role-box {
    flex: 1 1 260px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--ckb-bg-subtle);
    border-radius: 4px;
    padding: 6px 10px;
}

.ckb-shift-role-box h4 {
    margin: 0;
    flex: 0 0 auto;
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ckb-text-muted);
}

.ckb-shift-status {
    flex: 1 1 auto;
    font-size: 0.85em;
    min-height: 0;
}

.ckb-status-taken {
    color: var(--ckb-taken);
    font-weight: 600;
}

.ckb-status-open {
    color: var(--ckb-open);
    font-weight: 600;
}

.ckb-shift-action {
    flex: 0 0 auto;
    margin-left: auto;
}

.ckb-btn {
    color: #fff;
    border: none;
    padding: 6px 12px;
    font-size: 0.82em;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}
.ckb-claim-btn {
    background-color: var(--ckb-claim);
}
.ckb-claim-btn:hover {
    background-color: var(--ckb-claim-hover);
}
.ckb-leave-btn {
    background-color: var(--ckb-leave);
}
.ckb-leave-btn:hover {
    background-color: var(--ckb-leave-hover);
}
.ckb-btn:disabled {
    background-color: #ccc !important;
    cursor: not-allowed;
}

.ckb-no-screenings-message {
    font-size: 0.9em;
    font-style: italic;
    color: var(--ckb-text-muted);
    margin: 0;
}

@media (max-width: 700px) {
    .ckb-shift-card {
        flex-direction: column;
        align-items: stretch;
    }
    .ckb-shift-info {
        flex: 1 1 auto;
    }
    .ckb-shift-roles {
        flex-direction: column;
    }
    .ckb-shift-role-box {
        flex-wrap: wrap;
        flex: 0;
    }
    .ckb-shift-action {
        margin-left: 0;
        flex: 1 1 100%;
    }
}

/* --- Single Movie Details Screenings ([movie_screenings_list layout="details"]) --- */
.ckb-screenings-detail-wrapper {
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
}

.ckb-screening-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}
.ckb-screening-detail-item + .ckb-screening-detail-item {
    border-top: 1px solid #000;
}
.ckb-screening-info p {
    margin: 0;
    line-height: 1.4;
}
.ckb-screening-day {
    font-weight: 600; /* Bolded like the screenshot */
    font-size: 1.1em;
}
.ckb-screening-time {
    color: #333;
}

/* --- Filmreihen Navigation ([cinema_collections_nav]) --- */
.ckb-collections-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 24px;
}
.ckb-collections-nav-link {
    display: inline-block;
    padding: 6px 16px;
    border: 2px solid #1a1a1a;
    border-radius: 999px;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 0.9em;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}
.ckb-collections-nav-link:hover {
    background: #1a1a1a;
    color: #fff;
}
.ckb-collections-nav-link.is-active {
    background: #1a1a1a;
    color: #fff;
}

.ckb-loop-screenings ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}
.ckb-loop-screenings li {
    margin-bottom: 5px;
    font-size: 0.95em;
}
.ckb-no-screenings {
    font-size: 0.9em;
    font-style: italic;

    margin: 0;

}

.ckb-movies-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 movies next to each other */
    gap: 20px;
    margin: 20px 0;
}
.ckb-movie-card-grid {
    transition: transform 0.3s ease;
}
.ckb-movie-card-grid:hover {
    transform: translateY(-5px);
}

/* Calendar Button with Offset Border */
.ckb-cal-btn {
    position: relative;
    display: inline-block;
    background-color: var(--e-global-color-primary);
    color: #fff;
    text-decoration: none;
    transform-style: preserve-3d;
    padding: 8px 20px;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
    font-size: 0.9em;
    border: 2px solid var(--e-global-color-secondary);
    z-index: 1; /* Keeps button above the offset border */
    transition: transform 0.2s ease;
}
.ckb-cal-btn:hover,
.ckb-cal-btn:focus {
    color: #fff;
    text-decoration: none;
}
/* The Black Offset Border */
.ckb-cal-btn::before {
    content: "";
    position: absolute;
    top: 5px;   /* Push down */
    left: 5px;  /* Push right */
    right: -7px;
    bottom: -7px;
    border: 3px solid #1a1a1a; /* Dark border */
    z-index: -1; /* Puts the border behind the button */
    transition: transform 0.2s ease;
    transform: translateZ(-1px);
}

/* --- Booking Popup Modal --- */
.ckb-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ckb-modal-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}
.ckb-modal-content {
    position: relative;
    background: #fff;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 100000;
}
.ckb-modal-close {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 1.5em;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    line-height: 1;
}
.ckb-modal-close:hover {
    color: #000;
}
.ckb-form-group {
    margin-bottom: 15px;
}
.ckb-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
}
.ckb-form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
}
/* Differentiate the Reserve button color slightly if desired, or let it share the primary color */
.ckb-reserve-btn {
    background-color: #1a1a1a; /* Makes it black to contrast the Primary Color calendar button */
    margin-right: 10px;
    cursor: pointer;
}

/* Make it responsive! */
@media (max-width: 1024px) {
    .ckb-movies-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .ckb-movies-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .ckb-movies-grid { grid-template-columns: 1fr; }
}

/* --- Homepage Program Teaser ([cinema_home_teaser]) --- */
/* Desktop: 5 movies. Tablet & mobile: only 4 (the 5th card is hidden), still
   reflowing into fewer columns the narrower the screen gets. */
.ckb-home-teaser .ckb-movies-grid {
    grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 1024px) {
    .ckb-home-teaser .ckb-movies-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .ckb-home-teaser .ckb-movie-card-grid:nth-child(n+5) {
        display: none;
    }
}
@media (max-width: 768px) {
    .ckb-home-teaser .ckb-movies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .ckb-home-teaser .ckb-movies-grid {
        grid-template-columns: 1fr;
    }
}