
:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    --accent-color: #38bdf8;
    --danger-color: #f43f5e;
    --success-color: #10b981;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--card-bg);
    color: var(--text-primary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card h1,
.glass-card h2,
.glass-card h3,
.glass-card h4,
.glass-card h5,
.glass-card h6 {
    color: var(--text-primary);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px 0 rgba(0, 0, 0, 0.35);
}

/* Custom Buttons */
.btn-primary-custom {
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

.btn-primary-custom:hover {
    opacity: 0.95;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
    transform: scale(1.02);
}

.btn-danger-custom {
    background: var(--danger-color);
    border: none;
    color: white;
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

.btn-danger-custom:hover {
    opacity: 0.95;
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.4);
    transform: scale(1.02);
}

/* Form Controls */
.form-control-custom {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    color: var(--text-primary) !important;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.form-control-custom:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.form-control-custom::placeholder {
    color: var(--text-secondary);
}

/* Custom Tables */
.table-custom {
    color: var(--text-primary) !important;
    --bs-table-color: var(--text-primary) !important;
    --bs-table-bg: transparent !important;
    --bs-table-border-color: var(--card-border) !important;
    --bs-table-hover-color: var(--text-primary) !important;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05) !important;
    --bs-table-striped-color: var(--text-primary) !important;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02) !important;
}

.table-custom th, .table-custom td {
    background-color: transparent !important;
}

.table-custom th {
    font-weight: 600;
    color: var(--text-secondary) !important;
    border-bottom: 2px solid var(--card-border) !important;
}

.table-custom td {
    border-bottom: 1px solid var(--card-border) !important;
    vertical-align: middle;
}

/* Navbar overrides */
.navbar-custom {
    background: rgba(15, 23, 42, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    z-index: 1050;
    position: relative;
}

.navbar-brand-custom {
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #6366f1, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animated-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Header & Footer */
footer {
    margin-top: auto;
    background: rgba(15, 23, 42, 0.9);
    border-top: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 1.5rem 0;
}

/* Copy Token Box */
.copy-token-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px dashed var(--success-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: monospace;
    font-size: 1.1rem;
    color: #34d399;
}

/* Custom Utilities for contrast/readability */
.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-secondary) !important;
}

code {
    color: var(--accent-color) !important;
    background-color: rgba(56, 189, 248, 0.1) !important;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

/* Dark dropdown items contrast fix */
.dropdown-menu-dark .dropdown-item.text-danger {
    color: #ff6b6b !important;
}

.dropdown-menu-dark .dropdown-item.text-danger:hover {
    background-color: rgba(244, 63, 94, 0.15) !important;
    color: #ff8787 !important;
}

/* =========================================================
   CALENDAR STYLES
   ========================================================= */

/* --- Dot indicators --- */
.calendar-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar-dot-lg {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* --- Calendar card hover --- */
.calendar-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.calendar-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.4);
}

/* --- View toggle buttons --- */
.cal-view-toggle .btn {
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.cal-view-toggle .btn:first-child { border-radius: 8px 0 0 8px; }
.cal-view-toggle .btn:last-child  { border-radius: 0 8px 8px 0; }

/* --- Navigation bar --- */
.cal-nav-bar {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.5rem 1rem;
}
.cal-nav-label {
    font-size: 1rem;
}
.cal-nav-btn {
    padding: 0.3rem 0.8rem;
}

/* ===================
   MONTH GRID
   =================== */
.cal-grid-card {
    overflow: hidden;
    border-radius: 16px;
}

.cal-month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid var(--card-border);
}
.cal-month-header-cell {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    padding: 0.6rem 0;
}

.cal-month-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-day-cell {
    min-height: 100px;
    border-right: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: background 0.15s;
}
.cal-day-cell:hover { background: rgba(255,255,255,0.03); }
.cal-day-cell:nth-child(7n) { border-right: none; }

.cal-day-muted { opacity: 0.4; }

.cal-day-today { background: rgba(99, 102, 241, 0.07); }

.cal-day-number {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}
.cal-day-number-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}
.cal-day-number-link:hover {
    background: rgba(99,102,241,0.2);
    color: var(--text-primary);
}
.cal-today-number {
    background: #6366f1 !important;
    color: white !important;
}

.cal-add-dot {
    color: var(--text-secondary);
    font-size: 0.65rem;
    text-decoration: none;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
}
.cal-day-cell:hover .cal-add-dot { opacity: 1; }
.cal-add-dot:hover {
    background: rgba(99,102,241,0.25);
    color: var(--text-primary);
}

.cal-event-pill {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: filter 0.15s;
}
.cal-event-pill:hover { filter: brightness(1.3); color: var(--text-primary); }

.cal-more-badge {
    font-size: 0.68rem;
    color: var(--text-secondary);
    padding-left: 6px;
}

/* ===================
   WEEK GRID
   =================== */
.cal-week-card { overflow: hidden; }

.cal-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-week-day {
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    min-height: 320px;
}
.cal-week-day:last-child { border-right: none; }

.cal-week-today { background: rgba(99, 102, 241, 0.07); }

.cal-week-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 0.3rem;
    border-bottom: 1px solid var(--card-border);
    background: rgba(99,102,241,0.06);
    gap: 4px;
}
.cal-week-day-name {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--text-secondary);
}
.cal-week-day-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.cal-week-day-number:hover {
    background: rgba(99,102,241,0.2);
    color: var(--text-primary);
}

.cal-week-events {
    flex: 1;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: relative;
}

.cal-week-event {
    display: block;
    text-decoration: none;
    color: var(--text-primary);
    padding: 4px 6px;
    border-radius: 5px;
    font-size: 0.72rem;
    transition: filter 0.15s;
}
.cal-week-event:hover { filter: brightness(1.3); color: var(--text-primary); }

.cal-week-event-title { font-weight: 600; }
.cal-week-event-time  { font-size: 0.65rem; }

.cal-week-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
    opacity: 0.5;
}

.cal-week-add-btn {
    display: none;
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: rgba(99,102,241,0.25);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s;
}
.cal-week-events:hover .cal-week-add-btn {
    display: flex;
}
.cal-week-add-btn:hover { background: rgba(99,102,241,0.5); }

/* ===================
   DAY VIEW
   =================== */
.cal-day-event-card {
    display: block;
    background: var(--card-bg);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    border: 1px solid var(--card-border);
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.15s, box-shadow 0.15s;
}
.cal-day-event-card:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    color: var(--text-primary);
}

/* ===================
   EVENT DETAIL
   =================== */
.detail-block {
    background: rgba(15,23,42,0.5);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.9rem 1rem;
}
.detail-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}
.detail-value {
    font-weight: 600;
    font-size: 0.95rem;
}

.event-description-block {
    background: rgba(15,23,42,0.4);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1rem;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
}

/* --- Participant chips --- */
.participant-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 50px;
    padding: 4px 12px 4px 4px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}
.participant-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* ===================
   EVENT FORMS
   =================== */
.participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.participant-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15,23,42,0.5);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    padding: 5px 12px 5px 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: border-color 0.15s, background 0.15s;
}
.participant-checkbox-label:hover {
    border-color: rgba(99,102,241,0.4);
    background: rgba(99,102,241,0.08);
}
.participant-checkbox {
    display: none;
}
.participant-checkbox:checked + .participant-avatar-sm {
    outline: 2px solid #6366f1;
}
.participant-checkbox-label:has(.participant-checkbox:checked) {
    border-color: #6366f1;
    background: rgba(99,102,241,0.15);
}

.participant-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-primary);
    flex-shrink: 0;
}

/* Select override */
.form-select-custom {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    appearance: none;
}
.form-select-custom option {
    background: #1e293b;
    color: var(--text-primary);
}

