
:root {
    --calendar-width: 300px;
    --slots-width: 220px;
    --primary: hsl(220 45% 16% / 0.95);      /* earthy green (your base) */
    --primary-dark: hsl(220 45% 16% / 1);
    --accent: #b08b6b;       /* warm brown */
    --bg-soft: rgba(122, 155, 142, 0.12);
    --card: rgba(255, 255, 255, 0.7);
    --border: rgba(122, 155, 142, 0.25);
}

/* =========================
   BASE
========================= */



#booking-container {

    display: grid;
    grid-template-columns: repeat(2,minmax(360px,1fr));
    grid-template-rows: 480px auto;
    gap:2rem;
    padding:2rem;
    background-color: var(--primary-dark);
    margin-inline-end: 30%;
}

/* =========================
   WRAPPER LAYOUT (DESKTOP)
========================= */

#booking-wrapper {
    /*display: flex;
    align-items: flex-start;*/
    
    display: grid;
    grid-template-columns: repeat(2,480px);
    gap: 1rem;
}

/* =========================
   CALENDAR
========================= */

#calendar {
    flex: 1;
    position: relative;
    z-index: 2;
    grid-column: 1;
}

#weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    font-weight: bold;
    text-align: center;
    margin-bottom: 5px;
    color:#fff;
}

#month {
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
}
#month-nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;

    grid-column: 1/-1;
    margin-bottom: 10px;
    padding: 10px 12px;

    background: hsl(236, 19%, 30%);
    color: white;

    border-radius: 10px;
}
#month-label {
    font-weight: 500;
    text-align: center;
    flex: 1;
}
#month-nav button {
    background: rgba(255,255,255,0.9);
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}
#days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    position: relative;
}

/* outgoing */
.slide-out-left {
    animation: outLeft 0.18s ease forwards;
}

.slide-out-right {
    animation: outRight 0.18s ease forwards;
}

/* incoming */
.slide-in-right {
    animation: inRight 0.18s ease forwards;
}

.slide-in-left {
    animation: inLeft 0.18s ease forwards;
}

@keyframes outLeft {
    to { transform: translateX(-10px); opacity: 0; }
}

@keyframes outRight {
    to { transform: translateX(10px); opacity: 0; }
}

@keyframes inLeft {
    from { transform: translateX(-10px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes inRight {
    from { transform: translateX(10px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
#days div {
    padding: 10px;
    text-align: center;
    border: 1px solid #fff;
    color:#fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

#days div:hover:not(.disabled) {
    background: #e0f0ff;
}

.disabled {
    background: #f0f0f0;
    color: #aaa;
    pointer-events: none;
}

.today {
    background: var(--bg-soft);
    color: white;
    font-weight: bold;
}

.selected {
    background: var(--primary);
    color: white;
}

/* =========================
   SLOTS
========================= */
#slots {
    flex: 0 0 320px;  
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-inline: 1rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: relative;
    overflow-y: auto;
    max-height: 480px;
    margin-top: 1.5rem;
}
.slots-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* entering */
.slide-in-right {
    animation: slideInRight 0.3s ease;
}
.slide-in-left {
    animation: slideInLeft 0.3s ease;
}

/* leaving */
.slide-out-left {
    animation: slideOutLeft 0.3s ease;
}
.slide-out-right {
    animation: slideOutRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(40px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-40px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutLeft {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(-40px); opacity: 0; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(40px); opacity: 0; }
}
#slots button {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);

    background: var(--card);
    color: #2f3b35;
    transition: transform 0.15s ease, background 0.2s ease;
}

#slots button:hover:not(:disabled) {
   background: hsl(236, 19%, 30%);
    border-color: var(--primary);
    color:#ccc;
}

#slots button.booked {
    background: #ccc;
    cursor: not-allowed;
}

#slots button.selected-slot {
      background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
    transform: scale(1.03);
}
#slots button:disabled {
       background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.35);
    border-color: transparent;
    text-decoration: line-through;
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: 0.7;
}

/* =========================
   FORM
========================= */

#booking-form {
    max-width: 480px;
    display: grid;
    grid-template-columns: 1fr;
    box-shadow: 0 0 20px #9995;
    background: hsl(236, 19%, 30%);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    border-radius: 10px;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    padding:1rem;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

#booking-form.active {
    opacity: 1;
    pointer-events: auto;
    button{
        max-width: 360px;
        padding: .75em 3em;
        background: #fff;
        color:#666;
        place-self: center;
        border-radius: 5px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
    }
}

#booking-form > * {
    margin-bottom: 4px;
    padding: 0.5rem 1rem;
    border: none;
}
.booking-details >*{
    width: 100%;
    margin-bottom: 1rem;
    border: none;
    outline: none;
    padding: .5em 1em;
    overflow: hidden;
    border-radius: 5px;
}

/* =========================
   SUMMARY / MESSAGES
========================= */

#selection-summary {
    margin-bottom: 10px;
    padding: 8px;
    background: #eef6ff;
    border-radius: 6px;
}

#form-message {
    margin-top: 10px;
    font-weight: bold;
}

#purpose-preview,
#subject-hint {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 860px) {

    /* STACK EVERYTHING VISUALLY */
    #booking-container {
       display: grid;
       grid-template-rows: max-content max-content;
       margin-inline: auto;
       grid-template-columns: minmax(0,1fr);
    }

    /* wrapper becomes simple block */
    #booking-wrapper {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        gap: 1rem;
        padding: 0;
        max-height: none;
        height: auto;
    }
#calendar-viewport {
    overflow: hidden;
    width: 100%;
    position: relative;
}

#calendar-track {
    display: flex;
    transition: transform 0.45s ease;
    will-change: transform;
}

.month {
    min-width: 100%;
    flex-shrink: 0;
    padding: 0 10px;
}
    /* calendar full width */
    #calendar {
        width: 100%;
    }

    /* slots centered + full width */
    #slots {
        width: 100%;
        max-width: 100%;
        align-items: center;
        overflow: visible;
    }

    #slots button {
        width: 100%;
        max-width: 320px; /* keeps it nice, not stretched ugly */
    }

    /* FORM becomes natural flow element */
    #booking-form {
        width: 100%;
        max-width: 360px;
        margin: 1rem auto ;

        position: static !important;
        transform: none !important;
    }

    /* IMPORTANT: remove artificial jump */
    #booking-form.active {
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    /* remove weird expansion spacing */
    #booking-wrapper.expand-height {
        max-height: none;
    }
}
