/* ------------------ VARIABLES ------------------ */
:root {
    --font-size: 14px;
    --background: #ffffff;
    --foreground: oklch(0.145 0 0);
    --card: #ffffff;
    --card-foreground: oklch(0.145 0 0);
    --popover: oklch(1 0 0);
    --popover-foreground: oklch(0.145 0 0);
    --primary: #030213;
    --primary-foreground: oklch(1 0 0);
    --secondary: oklch(0.95 0.0058 264.53);
    --secondary-foreground: #030213;
    --muted: #ececf0;
    --muted-foreground: #717182;
    --accent: #e9ebef;
    --accent-foreground: #030213;
    --destructive: #d4183d;
    --destructive-foreground: #ffffff;
    --border: rgba(0, 0, 0, 0.1);
    --input: transparent;
    --input-background: #f3f3f5;
    --switch-background: #cbced4;
    --font-weight-medium: 500;
    --font-weight-normal: 400;
    --ring: oklch(0.708 0 0);
    --chart-1: oklch(0.646 0.222 41.116);
    --chart-2: oklch(0.6 0.118 184.704);
    --chart-3: oklch(0.398 0.07 227.392);
    --chart-4: oklch(0.828 0.189 84.429);
    --chart-5: oklch(0.769 0.188 70.08);
    --radius: 0.625rem;
    --sidebar: oklch(0.985 0 0);
    --sidebar-foreground: oklch(0.145 0 0);
    --sidebar-primary: #030213;
    --sidebar-primary-foreground: oklch(0.985 0 0);
    --sidebar-accent: oklch(0.97 0 0);
    --sidebar-accent-foreground: oklch(0.205 0 0);
    --sidebar-border: oklch(0.922 0 0);
    --sidebar-ring: oklch(0.708 0 0);
}

/* ------------------ DARK MODE ------------------ */
.dark {
    --background: oklch(0.145 0 0);
    --foreground: oklch(0.985 0 0);
    --card: oklch(0.145 0 0);
    --card-foreground: oklch(0.985 0 0);
    --popover: oklch(0.145 0 0);
    --popover-foreground: oklch(0.985 0 0);
    --primary: oklch(0.985 0 0);
    --primary-foreground: oklch(0.205 0 0);
    --secondary: oklch(0.269 0 0);
    --secondary-foreground: oklch(0.985 0 0);
    --muted: oklch(0.269 0 0);
    --muted-foreground: oklch(0.708 0 0);
    --accent: oklch(0.269 0 0);
    --accent-foreground: oklch(0.985 0 0);
    --destructive: oklch(0.396 0.141 25.723);
    --destructive-foreground: oklch(0.637 0.237 25.331);
    --border: oklch(0.269 0 0);
    --input: oklch(0.269 0 0);
    --ring: oklch(0.439 0 0);
    --chart-1: oklch(0.488 0.243 264.376);
    --chart-2: oklch(0.696 0.17 162.48);
    --chart-3: oklch(0.769 0.188 70.08);
    --chart-4: oklch(0.627 0.265 303.9);
    --chart-5: oklch(0.645 0.246 16.439);
    --sidebar: oklch(0.205 0 0);
    --sidebar-foreground: oklch(0.985 0 0);
    --sidebar-primary: oklch(0.488 0.243 264.376);
    --sidebar-primary-foreground: oklch(0.985 0 0);
    --sidebar-accent: oklch(0.269 0 0);
    --sidebar-accent-foreground: oklch(0.985 0 0);
    --sidebar-border: oklch(0.269 0 0);
    --sidebar-ring: oklch(0.439 0 0);
}

/* ------------------ BASE STYLES ------------------ */
html {
    font-size: var(--font-size);
}

body {
    background-color: var(--background);
    color: var(--foreground);
    font-weight: var(--font-weight-normal);
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Border & outline defaults */
* {
    border-color: var(--border);
    outline-color: var(--ring);
}

/* ------------------ TYPOGRAPHY ------------------ */
h1 { font-size: 2rem; font-weight: var(--font-weight-medium); line-height: 1.5; }
h2 { font-size: 1.5rem; font-weight: var(--font-weight-medium); line-height: 1.5; }
h3 { font-size: 1.25rem; font-weight: var(--font-weight-medium); line-height: 1.5; }
h4 { font-size: 1rem; font-weight: var(--font-weight-medium); line-height: 1.5; }
p, input { font-size: 1rem; font-weight: var(--font-weight-normal); line-height: 1.5; }
label, button { font-size: 1rem; font-weight: var(--font-weight-medium); line-height: 1.5; }

/* ------------------ UTILITIES ------------------ */
/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    margin-bottom: 0.5rem;
    color: var(--foreground);
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-foreground);
    z-index: 1;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    padding-left: 2.5rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    background-color: var(--input-background);
    color: var(--foreground);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.form-input::placeholder {
    color: var(--muted-foreground);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    outline: none;
    flex-shrink: 0;
}

.btn:focus-visible {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.btn svg:not([class*='size-']) {
    width: 1rem;
    height: 1rem;
}

/* Button Variants */
.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
    height: 2.25rem;
    padding: 0.5rem 1rem;
}

.btn-primary:hover {
    background-color: rgba(3, 2, 19, 0.9);
}

.btn-outline {
    border-color: var(--border);
    background-color: var(--background);
    color: var(--foreground);
    height: 2.25rem;
    padding: 0.5rem 1rem;
}

.btn-outline:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    height: 2.25rem;
    padding: 0.5rem 1rem;
}

.btn-secondary:hover {
    background-color: rgba(236, 236, 240, 0.8);
}

.btn-ghost {
    background-color: transparent;
    color: var(--foreground);
    height: 2.25rem;
    padding: 0.5rem 1rem;
}

.btn-ghost:hover {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

.btn-destructive {
    background-color: var(--destructive);
    color: var(--destructive-foreground);
    height: 2.25rem;
    padding: 0.5rem 1rem;
}

.btn-destructive:hover {
    background-color: rgba(212, 24, 61, 0.9);
}

/* Button Sizes */
.btn-sm {
    height: 2rem;
    border-radius: calc(var(--radius) - 2px);
    gap: 0.375rem;
    padding: 0 0.75rem;
}

.btn-lg {
    height: 2.5rem;
    border-radius: calc(var(--radius) - 2px);
    padding: 0 1.5rem;
}

.btn-icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
}

/* Full width for form buttons */
.btn-full {
    width: 100%;
}

/* Navigation Menu Styles */

.navigation-menu {
    position: relative;
    display: flex;
    max-width: max-content;
    flex: 1;
    align-items: center;
    justify-content: center;
}

.navigation-menu-list {
    display: flex;
    flex: 1;
    list-style: none;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
}

.navigation-menu-item {
    position: relative;
}

.navigation-menu-trigger {
    display: inline-flex;
    height: 2.25rem;
    width: max-content;
    align-items: center;
    justify-content: center;
    border-radius: calc(var(--radius) - 2px);
    background-color: var(--background);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: var(--foreground);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    outline: none;
    text-decoration: none;
}

.navigation-menu-trigger:hover,
.navigation-menu-trigger:focus {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

.navigation-menu-trigger:focus-visible {
    outline: 1px solid;
    outline-color: var(--ring);
    /* color: var(--accent-foreground); */
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.navigation-menu-trigger[data-state="open"] {
    background-color: rgba(233, 235, 239, 0.5);
    color: var(--accent-foreground);
}

.navigation-menu-trigger .chevron {
    position: relative;
    top: 1px;
    margin-left: 0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    transition: transform 0.3s;
}

.navigation-menu-trigger[data-state="open"] .chevron {
    transform: rotate(180deg);
}

.navigation-menu-link {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-radius: 0.125rem;
    padding: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    outline: none;
    text-decoration: none;
    color: var(--foreground);
}

.navigation-menu-link:hover,
.navigation-menu-link:focus {
    background-color: var(--accent);
    color: var(--accent-foreground);
}

.navigation-menu-link:focus-visible {
    outline: 1px solid;
    outline-color: var(--ring);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.navigation-menu-link[data-active="true"] {
    background-color: rgba(233, 235, 239, 0.5);
    color: var(--accent-foreground);
}

.navigation-menu-link svg:not([class*='text-']) {
    color: var(--muted-foreground);
}

.navigation-menu-link svg:not([class*='size-']) {
    width: 1rem;
    height: 1rem;
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: var(--font-weight-medium);
    border-radius: 9999px;
    border: 1px solid;
}

.badge-gold {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.badge-purple {
    background-color: #f3e8ff;
    color: #7c2d12;
    border-color: #e9d5ff;
}

.badge-green {
    background-color: #dcfce7;
    color: #14532d;
    border-color: #bbf7d0;
}

.badge-alert {
    margin-left: 0.5rem;
    background-color: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: var(--font-weight-medium);
    border-radius: 9999px;
    padding: 0.125rem 0.5rem;
    display: inline-block;
    line-height: 1;
    border: none;
    user-select: none;
}

.navbar .navbar-brand {
    display: flex;
    align-items: center;
}

.navbar-brand .site-logo {
    height: clamp(24px, 4vw, 56px);
    width: auto;
    display: block; /* avoid baseline gap */
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard {
    padding: 1rem;
    }

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

    .header-actions {
    justify-content: stretch;
    }

    .header-actions .btn {
    flex: 1;
    }

    .stats-grid {
    grid-template-columns: 1fr;
    }

    .performance-grid {
    grid-template-columns: 1fr;
    }

    .form-row {
    grid-template-columns: 1fr;
    }

    .auth-container {
    padding: 1rem;
    }
}

/* Custom Calendar Styling */
#myCalendarWrapper {
    background: var(--card, white);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    position: relative;
    flex: 1 1 auto;
    min-width: 0; /* critical for flex children shrinking correctly */
}

/* Flex wrapper: legend left, calendar right */
.calendar-legend-wrapper {
    display: flex;
    gap: 16px;
    width: 100%;
}

/* Legend */
.calendar-legend {
    display: flex;
    flex-direction: column;
    min-height: 60px;        /* much smaller minimum height */
    max-height: 400px;       /* reduced maximum height */
    max-width: 200px;        /* maximum width constraint */
    min-width: 140px;        /* minimum width for readability */
    overflow-y: auto;        /* scroll if too tall */
    overflow-x: hidden;      /* prevent horizontal overflow */
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    word-wrap: break-word;   /* handle long text */
}

.calendar-legend h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--foreground, #1f2937);
    line-height: 1.2;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
    margin-bottom: 0.125rem;
    padding: 0.125rem 0;
    line-height: 1.2;
    min-width: 0; /* Allow flex item to shrink */
    overflow: hidden; /* Hide overflow */
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-label {
    color: var(--foreground, #374151);
    font-weight: 500;
    text-transform: capitalize;
    flex: 1; /* Take remaining space */
    min-width: 0; /* Allow text to shrink */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Show ellipsis for long text */
}

/* Desktop: flex row of legend + calendar */
#calendarLegendCard {
    display: flex;
    flex-direction: column;
    max-width: 200px; /* Constrain card width */
    overflow-x: hidden; /* Prevent horizontal overflow */
}

/* legend scroll inside card */
#calendarLegendCard .calendar-legend {
    width: 100%;
    overflow-y: auto;
}

/* Desktop: legend on left, calendar on right */
@media(min-width: 768px) {
    .calendar-legend-wrapper {
        flex-direction: row;  /* row for left-right layout */
        align-items: flex-start;
    }

    .calendar-legend {
        max-width: 200px;    /* maximum width constraint */
        min-width: 140px;    /* minimum width for readability */
        overflow-y: auto;
        flex-shrink: 0;
    }

    #myOrganiserCalendar {
        flex: 1; /* calendar takes remaining space */
    }

    #ResultsCalendar {
        flex: 1; /* calendar takes remaining space */
        min-height: 400px; /* ensure calendar has minimum height */
        height: 100%; /* take full height of container */
    }
}

/* Mobile: stack legend above calendar */
@media (max-width: 767px) {
    #calendarLegendCard {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 1rem;
    }
    #myCalendarWrapper.parentNode {
        flex-direction: column !important;
        align-items: stretch;
    }
}

/* Force list view to use full available width */
.fc-view.fc-listWeek, 
.fc-view.fc-listMonth {
    width: 100% !important;
}

.fc-list-table {
    width: 100% !important;
    table-layout: auto; /* prevent fixed width shrinking */
}

.fc-scroller {
    overflow: visible !important; /* prevent inner container from restricting width */
    width: 100% !important;
}

/* Container for list events
.custom-list-event {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.5rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.15s ease;
}

.custom-list-event:hover {
    background: rgba(59, 130, 246, 0.05);
}

.list-event-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.list-event-title {
    flex: 1;
    font-weight: 500;
    color: #1f2937;
}

.list-event-time {
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: 0.5rem;
    white-space: nowrap;
}

/* Remove FullCalendar's default list-event background */
.fc-list-event {
    background: transparent !important; /* removes colored background */
}

/* Optional: remove left border if FullCalendar adds one */
.fc-list-event .fc-list-event-dot {
    background: none !important;
} */


/* Dynamic Event Category Colors - Override FullCalendar's default blue */
.fc-event {
    border: none !important;
    border-radius: 0.375rem !important;
    padding: 0.25rem 0.5rem !important;
    margin: 0.125rem 0 !important;
    font-size: 0.75rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.fc-event:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

.fc-event-title {
    font-weight: 600 !important;
    color: white !important;
}

.fc-event-time {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* Event Popover */
.event-popover {
    position: absolute;
    background: white;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    min-width: 280px;
    max-width: 350px;
}

.popover-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.popover-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: var(--foreground, #1f2937);
}

.popover-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--muted-foreground, #6b7280);
}

.popover-category-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
}

.popover-body {
    padding: 1rem;
}

.popover-description {
    margin-bottom: 0.75rem;
    color: var(--foreground, #374151);
    font-size: 0.875rem;
    line-height: 1.5;
}

.popover-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.popover-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--muted-foreground, #6b7280);
}

.popover-detail svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.popover-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border, #e5e7eb);
}

.popover-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
    border: 1px solid;
    cursor: pointer;
}

.popover-btn-primary {
    background: var(--primary, #3b82f6);
    border-color: var(--primary, #3b82f6);
    color: white;
}

.popover-btn-primary:hover {
    background: var(--primary-dark, #2563eb);
    border-color: var(--primary-dark, #2563eb);
    color: white;
    text-decoration: none;
}

.popover-btn-secondary {
    background: white;
    border-color: var(--border, #e5e7eb);
    color: var(--foreground, #374151);
}

.popover-btn-secondary:hover {
    background: var(--muted, #f3f4f6);
    color: var(--foreground, #374151);
    text-decoration: none;
}

.popover-btn svg {
    width: 14px;
    height: 14px;
}

/* Calendar Header Styling */
.fc-toolbar {
    padding: 1rem;
    background: var(--muted, #f8f9fa);
    border-bottom: 1px solid var(--border, #e5e7eb);
    margin-bottom: 0 !important;
}

.fc-toolbar-title {
    color: var(--foreground, #1f2937);
    font-weight: 600;
    font-size: 1.25rem;
}

.fc-button-group .fc-button {
    background: white;
    border: 1px solid var(--border, #e5e7eb);
    color: var(--foreground, #374151);
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    margin: 0 0.125rem;
}

.fc-button-group .fc-button:hover {
    background: var(--muted, #f3f4f6);
    border-color: var(--border, #d1d5db);
}

.fc-button-group .fc-button:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.fc-button-group .fc-button-active {
    background: var(--primary, #3b82f6) !important;
    border-color: var(--primary, #3b82f6) !important;
    color: white !important;
}

.fc-col-header-row {
    border-collapse: separate;
    border-spacing: 0;
}

.fc-scrollgrid-sync-table {
    width: 100% !important;
}

.fc-daygrid-day-frame {
    min-height: 80px; /* Consistent minimum height for day cells */
}

/* Calendar Grid Styling */
.fc-theme-standard .fc-scrollgrid {
    border: 1px solid var(--border, #e5e7eb);
}

.fc-theme-standard th {
    background: var(--muted, #f8f9fa);
    border-color: var(--border, #e5e7eb);
    color: var(--muted-foreground, #6b7280);
    font-weight: 500;
    padding: 0.75rem 0.5rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.fc-theme-standard td {
    border-color: var(--border, #e5e7eb);
}

/* Day cells */
.fc-daygrid-day {
    background: white;
    transition: background-color 0.2s ease;
}

.fc-daygrid-day:hover {
    background: var(--muted, #f8f9fa);
}

.fc-daygrid-day-top {
    padding: 0.5rem;
}

.fc-daygrid-day-number {
    color: var(--foreground, #1f2937);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
}

/* Other month days */
.fc-day-other .fc-daygrid-day-number {
    color: var(--muted-foreground, #9ca3af);
}

.fc-day-other {
    background: var(--muted, #fafafa);
}

/* Today highlighting */
.fc-day-today {
    background: rgba(59, 130, 246, 0.05) !important;
}

.fc-day-today .fc-daygrid-day-number {
    background: var(--primary, #3b82f6);
    color: white;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.fc-timegrid-event {
    margin-bottom: 4px;
    border-radius: 6px;
    font-size: 0.85rem;
    padding: 2px 4px;
}

/* Custom Event Styling */
.fc-event {
    border: none !important;
    border-radius: 0.25rem;
    padding: 0.125rem 0.25rem;
    margin: 0.125rem 0;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Custom event content styling */
.custom-event {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    padding: 0.125rem 0;
}

.event-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.event-status-dot.status-upcoming {
    background-color: #22c55e;
}

.event-status-dot.status-completed {
    background-color: #6b7280;
}

.event-status-dot.status-cancelled {
    background-color: #ef4444;
}

.event-title-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.event-time {
    font-size: 0.625rem;
    color: var(--muted-foreground, #6b7280);
    margin-right: 0.25rem;
}

/* Event colors based on status */
.fc-event.event-upcoming {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
    border-left: 3px solid #22c55e !important;
}

.fc-event.event-completed {
    background: rgba(107, 114, 128, 0.1);
    color: #374151;
    border-left: 3px solid #6b7280 !important;
}

.fc-event.event-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border-left: 3px solid #ef4444 !important;
    text-decoration: line-through;
}

/* More link styling */
.fc-more-link {
    color: var(--primary, #3b82f6);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
}

.fc-more-link:hover {
    color: var(--primary-dark, #2563eb);
}
/* More events popover styling */
.more-events-popover {
    min-width: 250px;
}

.more-event-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.more-event-item:hover {
    background-color: #f8fafc;
}

.more-event-item:last-child {
    border-bottom: none;
}

.more-event-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.more-event-content {
    flex: 1;
}

.more-event-title {
    font-weight: 500;
    font-size: 13px;
    line-height: 1.2;
}

.more-event-time {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

/* View selector styling */
.fc-customViewSelector-button {
    background: none !important;
    border: 1px solid #d1d5db !important;
    color: #374151 !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
}

.fc-customViewSelector-button:hover {
    background-color: #f9fafb !important;
}

/* Popover styling for "more" events */
.fc-popover {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    background: white;
}

.fc-popover-header {
    background: var(--muted, #f8f9fa);
    border-bottom: 1px solid var(--border, #e5e7eb);
    padding: 0.75rem;
    font-weight: 600;
    color: var(--foreground, #1f2937);
}

.fc-popover-body {
    padding: 0.5rem;
}

/* List view styling */
.fc-list {
    border: 1px solid var(--border, #e5e7eb);
}

.fc-list-event {
    border-bottom: 1px solid var(--border, #f3f4f6);
}

.fc-list-event:hover {
    background: var(--muted, #f8f9fa);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fc-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .fc-toolbar-title {
        font-size: 1.125rem;
        text-align: center;
    }
    
    .fc-button-group {
        justify-content: center;
    }
    
    .custom-event {
        font-size: 0.625rem;
    }
    
    .event-time {
        display: none; /* Hide time on mobile for space */
    }
}

/* Calendar container improvements */
#myCalendarWrapper .card-body {
    padding: 0;
}

#myOrganiserCalendar {
    /* padding: 1rem; */
    flex: 1 1 auto;
    min-width: 0; /* ensures proper shrinking in flex */
}

#ResultsCalendar {
    /* padding: 1rem; */
    flex: 1 1 auto;
    min-width: 0; /* ensures proper shrinking in flex */
    min-height: 400px; /* ensure calendar has minimum height */
    height: 100%; /* take full height of container */
}

/* Ensure calendar wrapper is visible */
#discoverCalendarWrapper {
    display: block !important;
}