/* ===================================================================
   SchedulerWeb - Site Stylesheet
   Clean, light design with consistent button and table styling.
   =================================================================== */

/* --- Base --- */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
}

/* --- Links --- */
a {
    color: #0077cc;
}

a:hover {
    color: #005a99;
}

/* --- Focus Styles --- */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* --- Buttons --- */
/* Primary button - use for the main action on the page (1 Primary, rest Secondary) */
.btn-primary {
    color: #fff;
    background-color: #337ab7;
    border-color: #2e6da4;
}

.btn-primary:hover {
    color: #fff;
    background-color: #286090;
    border-color: #204d74;
}

.btn-primary:active, .btn-primary:focus {
    background-color: #204d74;
    border-color: #1b3d5c;
}

/* Secondary button - use for all other actions */
.btn-secondary {
    color: #333;
    background-color: #f0f0f0;
    border-color: #ccc;
}

.btn-secondary:hover {
    color: #333;
    background-color: #e0e0e0;
    border-color: #adadad;
}

.btn-secondary:active, .btn-secondary:focus {
    background-color: #d4d4d4;
    border-color: #8c8c8c;
}

/* Danger button */
.btn-danger {
    color: #fff;
    background-color: #d9534f;
    border-color: #d43f3a;
}

.btn-danger:hover {
    color: #fff;
    background-color: #c9302c;
    border-color: #ac2925;
}

/* Button transition for smooth hover effect */
.btn {
    transition: all 0.2s ease-in-out;
}

/* --- Layout --- */
.border-top {
    border-top: 1px solid #e5e5e5;
}

.border-bottom {
    border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 60px;
    font-size: 0.85rem;
}

/* --- Navbar --- */
.bg-navbar {
    background-color: #f5f5f5 !important;
    border-bottom: 1px solid #d0d0d0 !important;
}

.navbar-brand {
    white-space: normal;
    display: flex;
    align-items: center;
}

.navbar-light .navbar-nav .nav-link {
    color: rgba(0, 0, 0, 0.65);
    font-size: 0.92rem;
    font-weight: 500;
    padding: 6px 12px;
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link:focus {
    color: #000000;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
}

.navbar-light .navbar-nav .nav-link.active {
    color: #000000;
}

.navbar-light .dropdown-menu {
    background-color: #ffffff;
    border: 1px solid #d8d8d8;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 4px 0;
}

.navbar-light .dropdown-menu .dropdown-item {
    color: rgba(0, 0, 0, 0.75);
    font-size: 0.9rem;
    padding: 7px 16px;
}

.navbar-light .dropdown-menu .dropdown-item:hover {
    background-color: #f0f0f0;
    color: #000000;
}

.navbar-light .dropdown-divider {
    border-color: #e0e0e0;
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    color: #fff;
    background-color: #337ab7;
    border-color: #2e6da4;
}

/* --- Tables --- */
/* All tables should use table-sm for compact display */
.table {
    font-size: 0.875rem;
}

/* Table header styling - clean, professional blue-grey */
.table thead th {
    background-color: #4a6785;
    color: #fff;
    font-weight: 600;
    border-color: #3d566e;
    padding: 8px 10px;
    vertical-align: middle;
}

.table thead th a {
    color: #fff;
    text-decoration: none;
}

.table thead th a:hover {
    color: #d0e0f0;
    text-decoration: underline;
}

/* Sortable table styles */
.sortable th {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.sortable th:hover {
    background-color: #3d566e;
}

.sortable th::after {
    content: '\2195';
    position: absolute;
    right: 8px;
    opacity: 0.4;
    font-size: 0.75rem;
}

.sortable th.sort-asc::after {
    content: '\2191';
    opacity: 1;
}

.sortable th.sort-desc::after {
    content: '\2193';
    opacity: 1;
}

/* --- Action Icons in Tables --- */
.action-icon {
    width: 18px;
    height: 18px;
    margin: 0 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.action-icon:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* Pencil/edit icon ~15% smaller than other action icons */
.action-icon[src$="edit.png"] {
    width: 15px;
    height: 15px;
}

/* --- Cards --- */
.card {
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

/* --- Forms --- */
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* --- Alerts --- */
.alert {
    font-size: 0.9rem;
}

/* --- Login Page --- */
.login-container {
    max-width: 400px;
    margin: 0 auto;
}
/* --- Calendar grid --- */
.calendar-grid {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.calendar-row {
    display: flex;
    border-bottom: 1px solid #dee2e6;
}

.calendar-row:last-child {
    border-bottom: none;
}

.calendar-cell {
    flex: 1 1 0;
    min-width: 0;
    min-height: 90px;
    padding: 4px 6px;
    border-right: 1px solid #dee2e6;
    font-size: 12px;
    overflow: hidden;
}

.calendar-cell:last-child {
    border-right: none;
}

.calendar-header-row {
    background-color: #4a6785;
}

.calendar-header-cell {
    color: #fff;
    font-weight: 600;
    text-align: center;
    min-height: auto;
    padding: 6px;
    font-size: 12px;
}

.calendar-cell-empty {
    background-color: #f8f9fa;
}

.calendar-cell-today {
    background-color: #fff8e1;
}

.calendar-day-number {
    font-weight: 600;
    color: #555;
    margin-bottom: 2px;
    font-size: 12px;
}

.calendar-event {
    display: block;
    background-color: #e7f1fb;
    border-left: 3px solid #337ab7;
    padding: 2px 4px;
    margin-bottom: 2px;
    border-radius: 2px;
    font-size: 11px;
    color: #333;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event:hover {
    background-color: #d0e3f5;
    color: #000;
    text-decoration: none;
}

.calendar-event-time {
    font-weight: 600;
    margin-right: 3px;
}

.calendar-event-op {
    color: #555;
    font-style: italic;
    margin-right: 2px;
}

@media (max-width: 576px) {
    .calendar-cell {
        min-height: 60px;
        font-size: 10px;
        padding: 2px;
    }
    .calendar-event {
        font-size: 10px;
        padding: 1px 2px;
    }
    .calendar-day-number {
        font-size: 11px;
    }
}
