/**
 * OCP Calendar CSS - Full 9-Column Daily View + Weekly/Monthly
 * Cloned from calendar.css - Single Header, Perfect Alignment
 * @package OntimeCP Members
 */

.site-branding {
    margin: 5px 0 !important;
}

.main-navigation ul {
    margin: 5px 0 !important;
}

.main-navigation ul li {
    padding: 5px 10px !important;
    font-size: 14px !important;
}

.calendar-section {
    max-width: 1220px;
    margin: 0 auto;
    padding: 10px;
    text-align: center;
    min-height: 1010px;
}

.header-top-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 10px;
    gap: 40px;
}

.today-button {
    order: 1;
}

.ontime-logo {
    order: 2;
    font-size: 1.8em;
    font-family: 'Segoe UI', sans-serif;
    font-weight: bold;
    background: linear-gradient(45deg, #4169e1, #800080);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-flex;
    align-items: center;
    margin: 0;
    flex-shrink: 0;
}

.ontime-logo::before {
    content: 'Calendar';
    margin-right: 8px;
    font-size: 1.1em;
}

.header-button-group {
    order: 3;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-button {
    padding: 8px 16px;
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #4169e1;
    border-radius: 5px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 11px;
    position: relative;
}

#tools-button, #blop-button, #briefcase-button, #options-button {
    margin: 0;
}

/* === DROPDOWN MENUS === */
.tools-menu {
    position: relative;
    display: inline-block;
}

#tools-dropdown,
#blop-dropdown,
#briefcase-dropdown,
#options-dropdown {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 5px;
    top: 100%;
    left: 0;
    border: 1px solid #d3d3d3;
    margin-top: 5px;
}

#tools-dropdown a,
#blop-dropdown a,
#briefcase-dropdown a,
#options-dropdown a {
    color: #000000;
    padding: 10px 14px;
    text-decoration: none;
    display: block;
    font-family: Arial, sans-serif;
    font-size: 11px;
    border-bottom: 1px solid #f0f0f0;
}

#tools-dropdown a:hover,
#blop-dropdown a:hover,
#briefcase-dropdown a:hover,
#options-dropdown a:hover {
    background-color: #d3d3d3;
}

/* Show dropdown on click (JS-controlled) */
.tools-menu.active #tools-dropdown,
.tools-menu.active #blop-dropdown,
.tools-menu.active #briefcase-dropdown,
.tools-menu.active #options-dropdown {
    display: block;
}

/* Fallback hover support */
.tools-menu:hover #tools-dropdown,
.tools-menu:hover #blop-dropdown,
.tools-menu:hover #briefcase-dropdown,
.tools-menu:hover #options-dropdown {
    display: block;
}

#calendar-header {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
}

#calendar-header button {
    padding: 8px 16px;
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #4169e1;
    border-radius: 5px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 11px;
}

#calendar-header .delete-appt {
    background-color: #ff0000;
    color: #ffffff;
    border: none;
}

#calendar-header .delete-appt:hover {
    background-color: #cc0000;
}

#calendar-header button:hover {
    background-color: #d3d3d3;
}

.view-button {
    background-color: #3498db;
    color: #ffffff;
    border-color: #3498db;
}

.view-button:hover {
    background-color: #2980b9;
}

#current-day,
#current-week,
#current-month {
    font-size: 1.1em;
    margin: 0 35px;
    color: #00008b;
    font-family: Arial, sans-serif;
    white-space: nowrap;
    min-width: 300px;
    max-width: 300px;
    text-align: center;
    display: inline-block;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 5px;
    border: 2px solid #4169e1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.calendar-header {
    width: 100%;
    margin-left: 5px;
    padding-left: 5px;
    max-width: 1220px;
    margin-bottom: 0;
}

.calendar-container {
    width: 100%;
    max-width: 1220px;
    min-height: 600px;
    overflow-x: auto;
    margin: 0;
}

/* === DAILY VIEW GRID - 9 COLUMNS === */
.calendar-grid-header,
.calendar-grid {
    width: 1210px;
    border-collapse: collapse;
    background-color: #ffffff;
    border: 0;
    table-layout: fixed;
    margin: 0 auto;
}

.calendar-grid-header th,
.calendar-grid td {
    border: 1px solid #000000;
    padding: 4px;
    text-align: left;
    font-family: 'Segoe UI', sans-serif;
    font-size: 11px;
    color: #000000;
    height: 6.5px;
    vertical-align: top;
    box-sizing: border-box;
}

.calendar-grid-header th {
    background-color: #d3d3d3;
    font-weight: bold;
    text-align: center;
}

.time-col       { width: 60px !important; min-width: 60px !important; max-width: 60px !important; }
.appt-col       { width: 755px !important; min-width: 755px !important; max-width: 755px !important; }
.priority-col   { width: 48px !important; min-width: 48px !important; max-width: 48px !important; }
.category-col   { width: 90px !important; min-width: 90px !important; max-width: 90px !important; }
.recurrence-col { width: 65px !important; min-width: 65px !important; max-width: 65px !important; }
.note-col       { width: 47px !important; min-width: 47px !important; max-width: 47px !important; }
.blop-col       { width: 47px !important; min-width: 47px !important; max-width: 47px !important; }
.briefcase-col  { width: 57px !important; min-width: 57px !important; max-width: 57px !important; }
.delete-col     { width: 40px !important; min-width: 40px !important; max-width: 40px !important; text-align: center; }

.calendar-grid .appointment {
    background-color: #add8e6;
    color: #000000;
    padding: 2px;
    cursor: pointer;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-grid .appointment:hover {
    background-color: #87ceeb;
}

.note-col,
.blop-col,
.briefcase-col {
    cursor: pointer;
    text-align: center;
    font-weight: bold;
}

.delete-checkbox {
    transform: scale(1.2);
    cursor: pointer;
    opacity: 1 !important;
    position: static !important;
    display: inline-block !important;
    margin: 0;
    vertical-align: middle;
    width: auto !important;
    height: auto !important;
}

.calendar-grid .delete-col .delete-checkbox {
    opacity: 1 !important;
    position: static !important;
    display: inline-block !important;
}

/* === MODAL STYLES === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 5px;
    width: 900px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
}

.close,
.close-note,
.close-delete,
.close-blop,
.close-briefcase,
.close-briefcase-edit,
.close-delete-options {
    float: right;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    font-weight: bold;
}

.close:hover,
.close-delete-options:hover {
    color: #000;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    min-width: 150px;
    max-width: 200px;
}

.form-group.full-width {
    flex: 0 0 100%;
    max-width: 400px;
}

.form-group label {
    display: block;
    margin: 5px 0;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #00008b;
    font-weight: 600;
}

#appointment-form input,
#appointment-form select,
#appointment-form textarea,
#note-form input,
#note-form textarea,
#delete-form input,
#delete-options-modal input,
#delete-options-modal select {
    width: 100%;
    padding: 8px;
    margin-bottom: 5px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 12px;
    border: 1px solid #d3d3d3;
    border-radius: 3px;
    box-sizing: border-box;
}

#appt-blop {
    font-size: 12px;
    padding: 6px;
}

#appointment-form textarea,
#note-form textarea {
    width: 400px;
    resize: vertical;
    font-size: 14px;
}

/* === UPDATED: NOTE FIELD BELOW MESSAGE + FOOTER WITH CLOSE & SAVE === */

/* Ensure Message and Notes are full-width */
#appointment-modal .form-row:nth-child(2) .form-group.full-width,
#appointment-modal .form-row:nth-child(3) .form-group.full-width {
    flex: 0 0 100%;
    max-width: 100%;
}

/* Notes field styling */
#appointment-modal #appt-notes {
    width: 100%;
    height: 120px;
    padding: 12px;
    font-size: 16px;
    font-family: 'Segoe UI', sans-serif;
    border: 1px solid #d3d3d3;
    border-radius: 5px;
    resize: vertical;
    box-sizing: border-box;
    margin-top: 8px;
}

/* Modal footer: Close left, Save right */
#appointment-modal .modal-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-radius: 0 0 5px 5px;
}

#appointment-modal .modal-footer button {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    min-width: 110px;
    border: none;
}

#appointment-modal .close-modal-btn {
    background: #95a5a6;
    color: white;
}

#appointment-modal .close-modal-btn:hover {
    background: #7f8c8d;
}

#appointment-modal .save-appt-btn {
    background: #3498db;
    color: white;
}

#appointment-modal .save-appt-btn:hover {
    background: #2980b9;
}

#appointment-form button,
#note-form button,
#delete-form button,
#delete-options-modal button {
    background-color: #3498db;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 12px;
    margin: 5px;
    font-weight: 600;
}

#appointment-form button:hover,
#note-form button:hover,
#delete-form button:hover,
#delete-options-modal button:hover {
    background-color: #2980b9;
}

#delete-form .cancel-delete,
#confirm-period-delete,
#confirm-recurrence-delete,
#confirm-all-delete {
    background-color: #ff4444;
}

#delete-form .cancel-delete:hover,
#confirm-period-delete:hover,
#confirm-recurrence-delete:hover,
#confirm-all-delete:hover {
    background-color: #cc0000;
}

#delete-form .cancel-delete {
    background-color: #d3d3d3;
    color: #000000;
}

#delete-form .cancel-delete:hover {
    background-color: #b0b0b0;
}

/* === BLOP STATION MODAL SPECIFIC === */
#blop-station-container .modal-content {
    width: 800px;
    max-width: 95%;
    padding: 22px;
}

#blop-station-modal .close-blop-control {
    font-size: 28px;
    color: #aaa;
}

#blop-station-modal .close-blop-control:hover {
    color: #e74c3c;
}

#blop-station-modal .tab-link {
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-bottom: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 13px;
}

#blop-station-modal .tab-link.active {
    background: #3498db;
    color: white;
}

#blop-station-modal .blop-item,
#blop-station-modal .global-blop-item {
    padding: 8px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#blop-station-modal .blop-item:hover,
#blop-station-modal .global-blop-item:hover {
    background: #eef;
}

#blop-station-modal .blop-item.selected {
    background: #3498db;
    color: white;
}

#blop-station-modal .cta-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
}

#blop-station-modal .cta-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#blop-station-modal .cta-button:hover:not(:disabled) {
    background: #2980b9;
}