/**
 * Office Digital Calendar & Meeting Scheduler - Application Styles
 */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #475569;
    --bg-main: #f8fafc;
    --bg-sidebar: #0f172a;
    --sidebar-text: #e2e8f0;
    --sidebar-muted: #94a3b8;
    --sidebar-active-bg: rgba(255, 255, 255, 0.08);
    --border-color: #e2e8f0;
    --event-official: #dc3545;
    --event-meeting: #0d6efd;
    --event-personal: #6f42c1;
    --event-holiday: #198754;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-main);
    color: #1e293b;
    overflow-x: hidden;
}

/* App Shell Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* Sidebar Styles */
.app-sidebar {
    width: 290px;
    background-color: var(--bg-sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 1030;
    transition: transform 0.3s ease-in-out;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.sidebar-brand h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.sidebar-content {
    padding: 1.25rem;
    overflow-y: auto;
    flex-grow: 1;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background-color: rgba(0, 0, 0, 0.15);
}

/* User Card in Sidebar */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* Category Filter Checklist */
.filter-card {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.filter-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sidebar-muted);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.filter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.2rem;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}

.filter-item:hover {
    background-color: var(--sidebar-active-bg);
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 8px;
}

/* Main Content Area */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: hidden;
}

/* Top Navigation Bar */
.app-header {
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.header-search {
    max-width: 380px;
    width: 100%;
}

/* Calendar Card Container */
.calendar-card {
    flex-grow: 1;
    background: #ffffff;
    margin: 1rem 1.5rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#calendar {
    flex-grow: 1;
    height: 100% !important;
}

/* FullCalendar Overrides */
.fc {
    font-family: inherit;
}

.fc .fc-toolbar.fc-header-toolbar {
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fc-toolbar-title {
    font-size: 1.35rem !important;
    font-weight: 700;
    color: #0f172a;
}

.fc .fc-button-primary {
    background-color: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    font-weight: 500;
    text-transform: capitalize;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s;
}

.fc .fc-button-primary:hover,
.fc .fc-button-primary:focus {
    background-color: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
    box-shadow: none;
}

.fc .fc-button-primary:disabled {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
}

.fc .fc-button-primary.fc-button-active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
}

.fc-daygrid-day.fc-day-today {
    background-color: #eff6ff !important;
}

.fc-event {
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 0.85rem;
    border: none !important;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.fc-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.12);
}

.event-locked-badge {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    padding: 1px 3px;
    font-size: 0.7rem;
    margin-right: 4px;
}

/* PWA Install Banner */
.pwa-install-banner {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.65rem 1.25rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    animation: slideDown 0.3s ease;
    z-index: 1040;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* Offline Badge */
.offline-pill {
    background-color: #dc3545;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    display: none;
    align-items: center;
    gap: 4px;
}

/* Modals Custom Styling */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid #f1f5f9;
    padding: 1rem 1.5rem;
}

/* Participants checklist box */
.participants-select-box {
    max-height: 180px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.5rem;
    background: #fdfdfd;
}

.participant-checkbox-item {
    display: flex;
    align-items: center;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
}

.participant-checkbox-item:hover {
    background: #f1f5f9;
}

/* Mobile Responsiveness */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1025;
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .calendar-card {
        margin: 0.75rem;
        padding: 0.75rem;
    }

    .app-header {
        padding: 0 1rem;
    }

    .fc-toolbar.fc-header-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }
}
