:root {
    --primary: #4CAF50;
    --primary-light: #5fa562;
    --secondary: #fd79a8;
    --tertiary: #00cec9;
    --background: #f8f9fa;
    --text: #2d3436;
    --text-light: #636e72;
    --available: #4CAF50;
    --booked: #fab1a0;
    --tentative: #ffeaa7;
    --alap: #def3e5;
    --unavailable: #dfe6e9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}
/*
body {
    background-color: var(--background);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 700px;
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    transition: all 0.3s ease;
    overflow-x: hidden;
}*/
#middle_column.calendarsite {
    /*background-color: var(--background);*/
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 700px;
    width: 700px;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    transition: all 0.3s ease;
    overflow-x: hidden;
}

#middle_column.calendarsite h1 {
    margin: 50px 0 20px;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.8rem;
    text-align: center;
    position: relative;
    width: 100%;
}

#middle_column.calendarsite h1::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    border-radius: 3px;
}

p.subtitle {
    color: var(--text-light);
    margin-bottom: 25px;
    text-align: center;
    font-size: 0.9rem;
}

.controls {
    /*display: flex;
    justify-content: center;
    align-items: center;*/
    margin: 20px 0;
    /*width: 100%;*/
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.month-display {
    font-weight: 600;
    color: var(--primary);
    min-width: 170px;
    text-align: center;
    font-size: 1.3rem;
}

.month-nav {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.month-nav:hover {
    background-color: transparent;
    color: var(--primary);
    transform: scale(1.3);
}

.legend {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-available {
    background-color: var(--alap);
}

.legend-booked {
    background-color: var(--booked);
}

.legend-tentative {
    background-color: var(--tentative);
}

.legend-unavailable {
    background-color: var(--unavailable);
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    width: 100%;
    gap: 10px;
    margin-bottom: 25px;
    margin-top: 20px;
}

.day-header {
    text-align: center;
    font-weight: 600;
    color: var(--text);
    padding: 5px 0;
    font-size: 0.9rem;
}

.calendar-day {
    aspect-ratio: 1/1;
    padding: 5px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    background-color: var(--unavailable);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.calendar-day:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.day-number {
    font-weight: 600;
    font-size: 1rem;
    padding: 2px 5px;
}

.status-indicator {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.status-icon {
    font-size: 1.2rem;
    margin-bottom: 10px;
    margin-top: -5px;
}

.status-text {
    font-size: 0.7rem;
    text-align: center;
}

.available {
    background-color: var(--available);
    color: white;
}

.booked {
    background-color: var(--booked);
}

.tentative {
    background-color: var(--tentative);
}

.unavailable {
    background-color: var(--unavailable);
}
.alap {
    background-color: var(--alap);
}

.outside-month {
    opacity: 0.5;
    cursor: default;
}

.past-day:hover {
    transform: none;
    box-shadow: none;
}

.edit-form, .edit-form-info {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 20px;
    width: 100%;
    max-width: 500px;
    position: fixed;
    left: 50%;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
}
.edit-form{
    top: 100px;
    transform: translate(-50%, 0);
}
.edit-form-info {
    top: 100px;
    transform: translate(-50%, 0);
    z-index: 101;
    /*max-width: 80%;*/
    min-height: 50dvh;
    box-shadow: 0 0 30px -5px black;
}

.edit-form.active, .edit-form-info.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.form-title {
    font-weight: 600;
    color: var(--primary);
}

.close-btn {
    background: none;
    padding: 0;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--secondary);
    background: none;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
    cursor: auto;
}

.status-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.status-option {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.status-option.selected {
    border-color: var(--primary);
    font-weight: 600;
}

.status-option:hover {
    transform: translateY(-2px);
}

.available-option {
    background-color: var(--available);
}

.booked-option {
    background-color: var(--booked);
}

.tentative-option {
    background-color: var(--tentative);
}

.unavailable-option {
    background-color: var(--unavailable);
}

.notes-input {
    width: 100% !important;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    resize: none;
    font-size: 0.9rem;
    min-height: 80px;
    display:none;
    transition: border-color 0.2s ease;
}

.notes-input:focus {
    outline: none;
    border-color: var(--primary-light);
}

.time-slots {
    display: grid;
    grid-template-columns: 50%;
    grid-template-rows: repeat(6, auto);
    grid-auto-flow: column;
    gap: 10px;
    margin-bottom: 15px;
}

.time-slot {
    padding: 8px;
    border-radius: 5px;
    text-align: center;
    background-color: #f1f1f1;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    font-weight: bold;
}

.time-slot.selected {
    background-color: var(--primary-light);
    color: white;
}
.time-slot.selected.noneditable {
    background-color: #fab1a0;
    cursor: zoom-in;
}

.save-btn, #save-all-booking {
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    display:none;
    transition: all 0.2s ease;
}

#save-all-booking {
    margin: 10px 0;
    width:auto;
}


.save-btn:hover, #save-all-booking:hover {
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: all;
}

.stats {
    display: flex;
    justify-content: space-around;
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    width: 100%;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(to right, var(--primary), var(--tertiary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
}

.tooltip {
    position: absolute;
    background: white;
    border-radius: 5px;
    padding: 8px 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
    max-width: 200px;
    white-space: normal;
}

.tooltip.visible {
    opacity: 1;
}

.quick-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.action-btn {
    flex: 1;
    background: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.action-btn i {
    font-size: 1rem;
}

.mark-available {
    border-bottom: 3px solid var(--available);
}

.mark-unavailable {
    border-bottom: 3px solid var(--unavailable);
}

.mark-tentative {
    border-bottom: 3px solid var(--tentative);
}
.caldrop{
    max-width: 100%;
    width: 350px;
}
.caldrop #carDropdown {
    position: absolute;
}

.showsave {
    display: inline-flex !important;
    width: auto;
}
input.selectall {
    position: absolute;
    right: 30px;
    margin-top: -30px;
}
label.selalllabel {
    text-align: right;
    padding: 10px 30px 10px 0px;
    cursor: pointer;
    -webkit-user-select:none;
    user-select:none;
}

.prevnext {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    justify-content: space-between;
}
.toggleday {
    padding: 5px 0;
    width: 40%;
    background: #797777;
}

.time-slot {
    position: relative; /* Hogy az X-et hozzá tudjuk igazítani */
}

.remove-slot-btn {
    position: absolute;
    top: 7px;
    right: 5px;
    color: #ff5252;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.remove-slot-btn:hover {
    background: #ff5252;
    color: white;
    transform: scale(1.1);
}

/* Konténer és Rendszer elrendezés */
.booking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    padding: 0;
    width: 100%;
}

/* Kártya alapstílusa */
.booking-card {
    background: #fafafa;
    border-radius: 12px;
    box-shadow: 0 0 5px 2px rgba(0,0,0,0.07);
    border-top: 5px solid #28a745; /* Zöld az egynaposnak */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Többnapos kártya megkülönböztetése */
.booking-card.multi-day-card {
    border-top-color: #28a745; /* Kék a többnaposnak */
}

/* Fejléc */
.card-header {
    padding: 12px 15px;
    background: #fafafa;
    border-bottom: 1px solid #eeeeee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;
}

.date-header {
    font-size: 1rem;
    line-height: 3rem;
    color: #333;
}

/* Státusz jelvények */
.status-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}
.status-pending { background: #fff3cd; color: #856404; }
.status-approved { background: #d4edda; color: #155724; }

/* Tartalmi rész */
.card-content {
    padding: 15px;
}

/* Időpontok megjelenítése */
.time-box {
    margin-bottom: 15px;
}

.time-label {
    display: block;
    font-size: 0.75rem;
    color: #777;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.time-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
}

/* Többnapos időpont speciális stílusa */
.multi-day-time {
    background: #f0f7ff;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #ddecff;
}

.time-arrow {
    color: #007bff;
    font-size: 1.2rem;
    margin: 5px 0;
    font-weight: bold;
}

/* Megjegyzés doboz */
.memo-box {
    margin-top: 12px;
    background: #f0f7ff;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid #5f5f5f;
}

.memo-text {
    font-size: 0.9rem;
    color: #444;
    margin-top: 4px;
    line-height: 1.4;
}

.no-bookings {
    text-align: center;
    padding: 40px;
    color: #888;
    font-style: italic;
}

.manual-booking-container {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px; /* Megfelelő szélesség asztali gépen */
    margin: 20px auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border-top: 5px solid #d7d7d7;
}
.manual-booking-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.25rem;
    text-align: center;
}



#bookingMessage {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
    min-height: 1.2rem;
    font-weight: bold;
    text-align: center;
}
.calendar-day.today {
    transform: scale(1.1);
    box-shadow: 2px 2px 2px 0px rgba(0, 0, 0, 0.4);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}


.input-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 50%;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 0;
    color: #444;
    padding-top: 0;
}

.input-group input, .input-group textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

.full-width { margin-top: 10px; width: 100%; }

.msave-btn {
    margin-top: 15px;
    padding: 12px 20px;
    background-color: #43a047;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
}

.msave-btn:hover { background-color: #218838; color: white;}





.delete-booking-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #dc3545; /* Piros szín */
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    transition: transform 0.2s, color 0.2s;
    z-index: 1;
}

.delete-booking-btn:hover {
    color: #a71d2a;
    background: none;
}

.booking-card {
    position: relative; /* Hogy a gomb abszolút pozícionálása működjön */
}

#middle_column hr {
    border: 0;
    height: 1px;
    background: #eee;
    margin-bottom: 25px;
}

/* Az adatok doboza */
.booking-details-box {
    border: 1px solid #dee2e6;
    background-color: #fcfcfc !important;
    line-height: 1.4;
    background: #f9f9f9; 
    padding: 10px; 
    border-radius: 8px; 
    margin: 20px 0; 
    text-align: left;
}

.booking-details-box p:last-child {
    border-bottom: none;
}

.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}

/* Státusz üzenet animációja */
#status-message {
    padding: 10px;
    border-radius: 4px;
    transition: all 0.3s;
}


.booking-details-box p {
    display: flex;
    flex-direction: column; /* Egymás alá rakja a Strong-ot és az értéket */
    padding-bottom: 10px;
}

.booking-details-box strong {
    width: 100%;
    margin-bottom: 3px;
}

.booking-time {
    display: block; /* Az időpontok külön sorba kerülnek */
    font-size: 0.95rem;
    border-radius: 4px;
    margin-bottom: 2px;
    width: fit-content;
}


/* Opcionális: a második időpont elé betehetünk egy "ig:" jelzést CSS-ből */
.booking-time:last-child::before {
    content: "Befejezés: ";
    color: #777;
}

.booking-time:first-of-type::before {
    content: "Kezdés: ";
    color: #777;
}








/* --- MOBIL NÉZET (768px alatt) --- */
@media (max-width: 600px) {
    .manual-booking-container {
        margin: 10px;
        padding: 15px;
    }

    .input-row {
        /*flex-direction: column;*/
        gap: 10px;
    }

    .input-group label {
        font-size: 0.9rem;
    }

    .input-group input, 
    .input-group select, 
    .input-group textarea {
        padding: 14px; /* Kicsit nagyobb érintési felület mobilra */
    }

    .save-btn {
        padding: 16px;
        font-size: 1.1rem;
    }
}

/* Mobilbarát Grid */
.booking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    padding: 10px;
}

.booking-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    /*border-left: 6px solid #28a745;*/
    margin-bottom: 10px;
}

.booking-card.multi-day { border-left-color: #007bff; }

.card-header {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    font-weight: bold;
}

.multi-day-info {
    background: #f0f7ff;
    padding: 10px;
    text-align: center;
    border-radius: 5px;
}

.status-badge {
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 10px;
}

.status-approved { background: #d4edda; color: #155724; }
.status-pending { background: #fff3cd; color: #856404; }

.calendar-day.past-day {
    opacity: 0.3;
    background-color: #ffffff;
    border: 1px solid lightgray;
}



/* MOBIL NÉZET (480px alatt) */
@media (max-width: 480px) {
    .booking-grid {
        grid-template-columns: 1fr; /* Mobilon egy oszlop */
    }
    
    .time-value {
        font-size: 1rem;
    }
    .card-header{
        flex-direction: column;
    }
    #action-container {
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .booking-grid {
        grid-template-columns: 1fr; /* Mobilon fix 1 oszlop */
    }
}


@media (max-width: 600px) {
    .calendar {
        gap: 5px;
    }
    
    .day-number {
        font-size: 1rem;
    }
    
    .status-icon {
        font-size: 1rem;
        margin: -18px -20px 0 0;
    }
    
    .status-text {
        font-size: 0.6rem;
    }
    
    .legend {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .quick-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .stats {
        flex-wrap: wrap;
    }
    
    .stat-item {
        width: 50%;
        margin-bottom: 10px;
    }
    .calendar-day{
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }
    .status-indicator{
        display:none;
    }
}

/* Animation for day toggles */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse-animation {
    animation: pulse 0.3s ease-in-out;
}

/* Loading spinner */
.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--primary-light);
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

@keyframes rotation {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.loading .loader {
    display: inline-block;
}

.loading .calendar,
.loading .controls,
.loading .stats,
.loading .quick-actions {
    opacity: 0.5;
    pointer-events: none;
}