@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    color-scheme: light;
}

body {
    background: #fbfbfd; /* Apple's subtle off-white background */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.itecam-card {
    border: 1px solid rgba(0, 0, 0, 0.04);
    background: #ffffff;
    border-radius: 1.5rem; /* Larger border radius for Apple feel */
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.itecam-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.admin-shell {
    min-height: 100vh;
    background: #f5f5f7;
}

.form-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 1rem;
    border: 1px solid #d2d2d7;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.8rem 1rem;
    color: #1d1d1f;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    font-family: inherit;
    font-size: 0.875rem;
}

.form-input:focus {
    border-color: #0071e3; /* Apple Blue */
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
    background: #ffffff;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 999px; /* Pill shaped */
    background: #0071e3;
    padding: 0.8rem 1.5rem;
    color: #ffffff;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover {
    background: #0077ed;
    transform: scale(1.02);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 999px;
    border: 1px solid #d2d2d7;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    padding: 0.8rem 1.5rem;
    color: #1d1d1f;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.04);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1;
}

.table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0;
}

.admin-table th {
    background: #fbfbfd;
    color: #86868b;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.7rem 0.8rem;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid #e5e5ea;
}

.admin-table td {
    border-top: 1px solid #f0f0f2;
    padding: 0.7rem 0.8rem;
    vertical-align: top;
    font-size: 0.875rem;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* FullCalendar Customizations for Apple Style */
.fc {
    font-family: inherit;
    --fc-border-color: #e5e5ea;
    --fc-button-bg-color: #f5f5f7;
    --fc-button-border-color: #d2d2d7;
    --fc-button-text-color: #1d1d1f;
    --fc-button-hover-bg-color: #e5e5ea;
    --fc-button-hover-border-color: #d2d2d7;
    --fc-button-active-bg-color: #0071e3;
    --fc-button-active-border-color: #0071e3;
    --fc-button-active-text-color: #ffffff;
    --fc-today-bg-color: rgba(0, 113, 227, 0.05);
}

.fc .fc-toolbar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1d1d1f;
}

.fc .fc-button {
    border-radius: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    box-shadow: none !important;
}

.fc .fc-button-primary:not(:disabled):active, .fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: var(--fc-button-active-bg-color);
    border-color: var(--fc-button-active-border-color);
}

.fc-theme-standard td, .fc-theme-standard th {
    border: 1px solid var(--fc-border-color);
}

.fc-daygrid-day-number {
    font-weight: 600;
    color: #1d1d1f;
}

.fc-event {
    border-radius: 0.5rem;
    padding: 2px 4px;
    font-weight: 600;
    font-size: 0.75rem;
    border: none !important;
    cursor: pointer;
    pointer-events: auto;
}

/* Day background for FullCalendar selectable */
.fc-highlight {
    background: rgba(0, 113, 227, 0.18) !important;
    border: 2px solid rgba(0, 113, 227, 0.35) !important;
    border-radius: 0.5rem;
}

.fc .fc-bg-event.selected-rental-range {
    background: rgba(0, 113, 227, 0.28) !important;
    opacity: 1;
    position: relative;
}

.fc .fc-daygrid-day.is-selected-rental-day .fc-daygrid-day-frame {
    background: rgba(0, 113, 227, 0.1);
    box-shadow: inset 0 0 0 2px rgba(0, 113, 227, 0.55);
}

.fc .fc-daygrid-day.is-selected-rental-day .fc-daygrid-day-number {
    color: #005bb5;
    font-weight: 900;
}

.fc .fc-bg-event.selected-rental-range::after {
    content: "Đang chọn";
    position: absolute;
    inset: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(0, 113, 227, 0.55);
    border-radius: 0.65rem;
    color: #005bb5;
    font-size: 0.7rem;
    font-weight: 800;
    pointer-events: none;
}

.fc-day-disabled {
    background: #f5f5f7 !important;
    opacity: 0.5;
}

/* Make day cells clickable even over events */
.fc-daygrid-day-frame {
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.fc-daygrid-day-events {
    pointer-events: auto;
}

.fc-daygrid-event {
    min-height: 1.65rem;
    align-items: center;
}

/* Mobile responsive fixes */
@media (max-width: 640px) {
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }
    .fc .fc-toolbar-title {
        font-size: 1rem;
    }
    .fc .fc-button {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    .fc-daygrid-day-number {
        font-size: 0.75rem;
        padding: 2px 4px;
    }
    .fc-event {
        font-size: 0.6rem;
        padding: 1px 2px;
        min-height: 1.35rem;
    }
    .fc .fc-scroller-liquid-absolute,
    .fc .fc-scroller {
        overflow: visible !important;
    }
    .admin-shell main {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
        white-space: normal;
        text-align: center;
    }
    .itecam-card {
        border-radius: 1rem;
    }
    section {
        overflow-x: hidden;
    }
}
