/* Calendar Page Styles */
.calendar-layout {
    display: flex;
    height: 100%;
    width: 100%;
    background: #fff;
    overflow: hidden;
}

.calendar-sidebar {
    width: 200px;
    background: #f5f5f5;
    border-right: 1px solid #e5e5e5;
    padding: 20px 0;
    flex-shrink: 0;
}

.cal-sidebar-group {
    padding: 0 15px;
    margin-bottom: 20px;
}

.cal-sidebar-title {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.cal-sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: #444;
}

.cal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.color-blue {
    background-color: #007aff;
}

.color-purple {
    background-color: #af52de;
}

.color-green {
    background-color: #34c759;
}

.calendar-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px;
    border-bottom: 1px solid #eee;
}

.cal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.cal-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cal-nav-btn {
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: background 0.2s;
}

.cal-nav-btn:hover {
    background-color: #f0f0f0;
}

.cal-today-btn {
    background: #fff;
    border: 1px solid #ddd;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin: 0;
}

.cal-today-btn:active {
    background: #f5f5f5;
}

/* Calendar Grid */
.cal-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    background: #fafafa;
}

.cal-days-header div {
    text-align: right;
    padding-right: 15px;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(80px, 1fr);
    flex: 1;
    overflow-y: auto;
}

.cal-day {
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    padding: 8px;
    position: relative;
    cursor: pointer;
    transition: background 0.1s;
}

.cal-day:hover {
    background-color: #f9f9f9;
}

.cal-day-num {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    /* align to right */
    border-radius: 50%;
}

.cal-day.prev-month,
.cal-day.next-month {
    background-color: #fdfdfd;
}

.cal-day.prev-month .cal-day-num,
.cal-day.next-month .cal-day-num {
    color: #ccc;
}

.cal-day.today .cal-day-num {
    background-color: #ff3b30;
    color: white;
}

.cal-event-dot {
    width: 4px;
    height: 4px;
    background-color: #ff3b30;
    border-radius: 50%;
    margin: 4px auto 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 8px;
}

.cal-work-dot {
    width: 4px;
    height: 4px;
    background-color: #007aff;
    /* Blue for Work */
    border-radius: 50%;
    /* Position slightly left if both exist, or center if alone. 
       For simplicity, let's stack them or put them side-by-side. 
       Let's use a container if multiple dots, but for now strict absolute positioning. */
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-150%);
    /* Shift left to allow space */
}

/* Adjust red dot if work dot exists? 
   Actually, the user asked for "work circle to each from mon to fri". 
   This implies a recurring visual.
   Let's position the red dot (meetings) slightly right to avoid overlap if needed, 
   or just center them. 
   
   Better strategy: Use a dot container in JS and basic dots. 
   But for CSS simplicity, let's keep them absolute but offset.
*/
.cal-dots-container {
    position: absolute;
    bottom: 6px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 3px;
}

.cal-dot-marker {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.marker-meeting {
    background-color: #ff3b30;
}

.marker-work {
    background-color: #007aff;
}

/* Booking Modal */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(2px);
}

.modal-window {
    width: 400px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: modalPop 0.2s cubic-bezier(0.1, 0.9, 0.2, 1);
}

@keyframes modalPop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    background: #f5f5f5;
    padding: 12px 16px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    font-size: 13px;
    color: #007aff;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-input-title {
    width: 100%;
    border: none;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
    outline: none;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.modal-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 13px;
}

.modal-row label {
    width: 60px;
    color: #777;
    flex-shrink: 0;
}

.modal-input-text {
    flex: 1;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-inputs input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
    font-family: inherit;
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

.modal-add-btn {
    background-color: #007aff;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    margin: 0;
}

.modal-add-btn:hover {
    background-color: #006ce6;
}

@media (max-width: 600px) {
    .calendar-sidebar {
        display: none;
    }

    .modal-window {
        width: 90%;
    }
}

/* Sidebar Contact Form */
.sidebar-input,
.sidebar-textarea {
    width: 100%;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid #d1d1d6;
    /* System gray 4 */
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    outline: none;
    background-color: #fff;
    transition: border-color 0.2s;
    display: block;
}

.sidebar-input:focus,
.sidebar-textarea:focus {
    border-color: #007aff;
}

.sidebar-textarea {
    resize: none;
    height: 80px;
}

.sidebar-send-btn {
    width: 100%;
    background-color: #f5f5f7;
    /* System gray 6 / button feel */
    color: #007aff;
    border: 1px solid #d1d1d6;
    border-radius: 6px;
    padding: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-send-btn:hover {
    background-color: #007aff;
    color: white;
    border-color: #007aff;
}

/* Ensure placeholder text is readable */
::placeholder {
    color: #999;
}