/* Base Styles - Always Loaded */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* CSS Variables for Style System */
    --border-radius-small: 4px;
    --border-radius-medium: 8px;
    --border-radius-large: 12px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.15);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
    
    /* Standard Control Dimensions */
    --control-height: 40px;
    --control-padding: 0.875rem;
    --control-padding-sm: 0.5rem;
    --control-margin: 1rem;
    
    /* Common Transition */
    --standard-transition: all 0.2s ease;
    
    /* Default Light Theme Colors */
    --background-primary: #f8f9fa;
    --background-secondary: #ffffff;
    --background-tertiary: #f1f3f4;
    --text-primary: #333333;
    --text-secondary: #6c757d;
    --text-inverse: #ffffff;
    --border-primary: #e9ecef;
    --border-secondary: #dee2e6;
    --calendar-picker-filter: none; /* Date/time picker icons stay default (black) for light theme */
    --border-light: #f8f9fa;
    --error-color: #dc3545;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    
    /* Modal Colors */
    --modal-background: #ffffff;
    --modal-text: #333333;
    --modal-header-background: #ffffff;
    --modal-header-border: #e5e7eb;
    
    /* Button Colors */
    --button-primary-bg: #667eea;
    --button-primary-text: #ffffff;
    --button-secondary-bg: #6c757d;
    --button-secondary-text: #ffffff;
    --button-danger-bg: #dc3545;
    --button-danger-text: #ffffff;
    
    /* Input Colors */
    --input-background: #ffffff;
    --input-border: #ced4da;
    --input-border-focus: #80bdff;
    --input-text: #495057;
    
    /* Glass/Glassmorphism Effects */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-bg-light: rgba(255, 255, 255, 0.2);
    --glass-bg-lighter: rgba(255, 255, 255, 0.3);
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);
    --glass-border-light: 1px solid rgba(255, 255, 255, 0.3);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
}

.login-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Base Layout */
.main-content {
    flex: 1;
    margin-left: 280px;
    overflow-x: hidden;
}

/* Basic Form Elements */
input, select, textarea, button {
    font-family: inherit;
}

/* Utility Classes */
.loading {
    opacity: 0.7;
}

.error {
    color: #dc3545;
}

.success {
    color: #28a745;
}

/* Theme Data Attributes for Color Schemes */
[data-theme="default"] {
    --primary-color: #667eea;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

[data-theme="ocean"] {
    --primary-color: #006994;
    --primary-gradient: linear-gradient(135deg, #006994 0%, #0891b2 100%);
}

[data-theme="forest"] {
    --primary-color: #065f46;
    --primary-gradient: linear-gradient(135deg, #065f46 0%, #047857 100%);
}

[data-theme="sunset"] {
    --primary-color: #ea580c;
    --primary-gradient: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
}

[data-theme="purple"] {
    --primary-color: #7c3aed;
    --primary-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
}

[data-theme="dark"] {
    --primary-color: #374151;
    --primary-gradient: linear-gradient(135deg, #374151 0%, #1f2937 100%);

    /* Dark Theme Overrides */
    --background-primary: #111827;
    --background-secondary: #1f2937;
    --background-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-inverse: #111827;
    --border-primary: #374151;
    --border-secondary: #4b5563;
    --border-light: #6b7280;
    --calendar-picker-filter: invert(1) brightness(0.9); /* Invert calendar/clock icons for dark theme */
    
    /* Modal Colors - Dark */
    --modal-background: #1f2937;
    --modal-text: #f3f4f6;
    --modal-header-background: #1f2937;
    --modal-header-border: #374151;
    
    /* Button Colors - Dark */
    --button-primary-bg: #4f46e5;
    --button-primary-text: #ffffff;
    --button-secondary-bg: #4b5563;
    --button-secondary-text: #ffffff;
    --button-danger-bg: #dc2626;
    --button-danger-text: #ffffff;
    
    /* Input Colors - Dark */
    --input-background: #374151;
    --input-border: #4b5563;
    --input-border-focus: #6366f1;
    --input-text: #f9fafb;
    
    /* Glass Effects - Dark */
    --glass-bg: rgba(0, 0, 0, 0.2);
    --glass-bg-light: rgba(0, 0, 0, 0.3);
    --glass-bg-lighter: rgba(0, 0, 0, 0.4);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-border-light: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="rose"] {
    --primary-color: #e11d48;
    --primary-gradient: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
}

[data-theme="mint"] {
    --primary-color: #10b981;
    --primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

[data-theme="midnight"] {
    --primary-color: #4c9aff;
    --primary-gradient: linear-gradient(135deg, #0f1419 0%, #151b26 100%);
    --calendar-picker-filter: invert(1) brightness(0.9);
}

[data-theme="charcoal"] {
    --primary-color: #4ade80;
    --primary-gradient: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    --calendar-picker-filter: invert(1) brightness(0.9);
}

[data-theme="nord"] {
    --primary-color: #88c0d0;
    --primary-gradient: linear-gradient(135deg, #2e3440 0%, #3b4252 100%);
    --calendar-picker-filter: invert(1) brightness(0.9);
}

[data-theme="dracula"] {
    --primary-color: #bd93f9;
    --primary-gradient: linear-gradient(135deg, #282a36 0%, #44475a 100%);
    --calendar-picker-filter: invert(1) brightness(0.9);
}* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
}

.login-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Sidebar Styles */
.app-sidebar {
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    overflow: hidden;
}

.sidebar-header {
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.sidebar-header h1 {
    margin: 0 0 1rem 0;
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
}

.user-info {
    text-align: center;
    margin-bottom: 0.5rem;
}

.user-info .username {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.25rem;
}

.user-info .server-url {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    word-break: break-all;
    line-height: 1.2;
}

.user-info.loading {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    font-style: italic;
}


.calendar-list {
    flex: 1;
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    overflow-y: auto;
    min-height: 0;
    /* Minimum height for at least 2 calendar items (header + 2 items) */
    min-height: calc(1rem + 0.75rem + (2 * (1rem + 2.25rem + 0.5rem)));
}

.calendar-list h3 {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calendar-list li {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
    gap: 0.75rem;
}

.calendar-list li:hover {
    background: rgba(255,255,255,0.15);
    transform: translateX(2px);
}


.calendar-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.3);
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.calendar-list li:hover .calendar-color {
    border-color: rgba(255,255,255,0.6);
    transform: scale(1.1);
}

/* Inline color picker for forms */
.color-picker {
    background: var(--modal-background);
    border-radius: 4px;
    padding: 1rem;
    border: 1px solid var(--border-primary);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    max-width: 220px;
    position: relative;
    z-index: 1000000;
}

/* Dropdown color picker for sidebar calendars */
.color-picker-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--modal-background);
    border-radius: 4px;
    padding: 1rem;
    border: 1px solid var(--border-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 999999;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    min-width: 160px;
    border: 1px solid rgba(0,0,0,0.1);
}
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    min-width: 160px;
    border: 1px solid rgba(0,0,0,0.1);
}

.color-option {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    border: 3px solid rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    box-sizing: border-box;
}

.color-option:hover {
    transform: translateY(-2px);
    border-color: rgba(0,0,0,0.2);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.color-option.selected {
    border-color: #2563eb;
    border-width: 3px;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3),
                0 4px 8px rgba(0,0,0,0.15);
}

.color-option.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
    z-index: 1;
}

.color-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
}


.calendar-name {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    flex: 1;
}

.no-calendars {
    padding: 1rem;
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    font-style: italic;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
    flex-shrink: 0;
}

.app-main {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    max-width: calc(100% - 280px);
    width: calc(100% - 280px);
    box-sizing: border-box;
}

/* Responsive Sidebar - Minimum 600px height support */
@media (max-height: 900px) and (min-height: 600px) {
    .sidebar-header {
        padding: 1.2rem 1.2rem 0.8rem;
    }
    
    .sidebar-header h1 {
        font-size: 1.4rem;
        margin: 0 0 0.5rem 0;
    }
    
    .user-info {
        margin-bottom: 0.2rem;
    }
    
    .user-info p {
        margin: 0.15rem 0;
        font-size: 0.8rem;
    }
    
    .calendar-list {
        padding: 0.6rem;
        min-height: calc(0.8rem + 0.5rem + (2 * (0.8rem + 1.8rem + 0.4rem)));
    }
    
    .calendar-list h3 {
        font-size: 0.85rem;
        margin: 0 0 0.5rem 0;
    }
    
    .calendar-list li {
        padding: 0.3rem 0.5rem;
        gap: 0.4rem;
        margin-bottom: 0.2rem;
    }
    
    .calendar-list ul {
        gap: 0.3rem;
    }
    
    
    .external-calendar-info {
        padding: 0.3rem 0.5rem;
        gap: 0.4rem;
    }
    
    .sidebar-footer {
        padding: 0.6rem;
    }
    
    .add-calendar-button {
        margin-bottom: 0.25rem !important;
        padding: 0.3rem 0.6rem !important;
        font-size: 0.8rem;
    }
    
    .view-selector {
        margin-bottom: 0.25rem !important;
    }
    
    .view-selector-dropdown {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.8rem;
    }
    
    .theme-selector,
    .style-selector {
        margin-bottom: 0.25rem !important;
    }
    
    .theme-selector-dropdown,
    .style-selector-dropdown {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.8rem;
    }
    
    /* Compact calendar headers */
    .calendar-header {
        padding: 1rem 1.5rem !important;
    }
    
    .month-year {
        font-size: 1.5rem !important;
    }
    
    .week-day-header {
        min-height: 60px !important;
        padding: 0.4rem !important;
    }
    
    .weekday-header {
        padding: 0.8rem !important;
        font-size: 0.85rem !important;
    }
    
    .weekday-name {
        font-size: 0.85rem !important;
    }
    
    .week-day-header .day-number {
        font-size: 1.3rem !important;
    }
    
    .logout-button {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}

@media (max-height: 750px) and (min-height: 600px) {
    .calendar-grid {
        --calendar-header-height: 80px;
        --weekday-header-height: 45px;
    }
    
    .sidebar-header {
        padding: 0.8rem 1rem 0.5rem;
    }
    
    .sidebar-header h1 {
        font-size: 1.2rem;
        margin: 0 0 0.3rem 0;
    }
    
    .user-info {
        margin-bottom: 0.1rem;
    }
    
    .user-info p {
        font-size: 0.75rem;
        margin: 0.1rem 0;
    }
    
    .calendar-list {
        padding: 0.4rem;
        min-height: calc(0.75rem + 0.4rem + (2 * (0.75rem + 1.6rem + 0.25rem)));
    }
    
    .calendar-list h3 {
        font-size: 0.8rem;
        margin: 0 0 0.4rem 0;
    }
    
    .calendar-list li {
        padding: 0.25rem 0.4rem;
        gap: 0.3rem;
        margin-bottom: 0.15rem;
    }
    
    .calendar-list ul {
        gap: 0.2rem;
    }
    
    .calendar-name {
        font-size: 0.8rem;
    }
    
    
    .external-calendar-info {
        padding: 0.25rem 0.4rem;
        gap: 0.3rem;
    }
    
    .external-calendar-name {
        font-size: 0.75rem;
    }
    
    .sidebar-footer {
        padding: 0.4rem;
    }
    
    .add-calendar-button {
        margin-bottom: 0.15rem !important;
        padding: 0.2rem 0.4rem !important;
        font-size: 0.75rem;
    }
    
    .view-selector {
        margin-bottom: 0.15rem !important;
    }
    
    .view-selector-dropdown {
        padding: 0.2rem 0.3rem !important;
        font-size: 0.75rem;
    }
    
    .theme-selector,
    .style-selector {
        margin-bottom: 0.15rem !important;
    }
    
    .theme-selector-dropdown,
    .style-selector-dropdown {
        padding: 0.2rem 0.3rem !important;
        font-size: 0.75rem;
    }
    
    /* More compact calendar headers */
    .calendar-header {
        padding: 0.8rem 1.2rem !important;
    }
    
    .month-year {
        font-size: 1.3rem !important;
    }
    
    .week-day-header {
        min-height: 55px !important;
        padding: 0.3rem !important;
    }
    
    .weekday-header {
        padding: 0.6rem !important;
        font-size: 0.8rem !important;
    }
    
    .weekday-name {
        font-size: 0.8rem !important;
    }
    
    .week-day-header .day-number {
        font-size: 1.2rem !important;
    }
    
    /* Adjust weekday header height for responsive row calculation */
    .calendar-grid {
        --weekday-header-height: 45px;
    }
    
    
    .logout-button {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
}

@media (max-height: 650px) {
    .calendar-grid {
        --calendar-header-height: 75px;
        --weekday-header-height: 40px;
    }
    
    .sidebar-header {
        padding: 0.5rem 0.8rem 0.3rem;
    }
    
    .sidebar-header h1 {
        font-size: 1rem;
        margin: 0 0 0.2rem 0;
    }
    
    .user-info {
        margin-bottom: 0.05rem;
    }
    
    .user-info p {
        font-size: 0.7rem;
        margin: 0.05rem 0;
    }
    
    .calendar-list {
        padding: 0.3rem;
        min-height: calc(0.7rem + 0.3rem + (2 * (0.7rem + 1.4rem + 0.2rem)));
    }
    
    .calendar-list h3 {
        font-size: 0.75rem;
        margin: 0 0 0.3rem 0;
    }
    
    .calendar-list li {
        padding: 0.2rem 0.3rem;
        gap: 0.25rem;
        margin-bottom: 0.1rem;
    }
    
    .calendar-list ul {
        gap: 0.15rem;
    }
    
    .calendar-name {
        font-size: 0.75rem;
    }
    
    .calendar-color {
        width: 12px;
        height: 12px;
    }
    
    
    .external-calendar-list h3 {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
    }
    
    .external-calendar-info {
        padding: 0.2rem 0.3rem;
        gap: 0.25rem;
    }
    
    .external-calendar-name {
        font-size: 0.7rem;
    }
    
    .external-calendar-color {
        width: 8px;
        height: 8px;
    }
    
    .sidebar-footer {
        padding: 0.3rem;
    }
    
    .add-calendar-button {
        margin-bottom: 0.1rem !important;
        padding: 0.15rem 0.3rem !important;
        font-size: 0.7rem;
    }
    
    .view-selector {
        margin-bottom: 0.1rem !important;
    }
    
    .view-selector-dropdown {
        padding: 0.15rem 0.25rem !important;
        font-size: 0.7rem;
    }
    
    .theme-selector,
    .style-selector {
        margin-bottom: 0.1rem !important;
    }
    
    .theme-selector-dropdown,
    .style-selector-dropdown {
        padding: 0.15rem 0.25rem !important;
        font-size: 0.7rem;
    }
    
    /* Most compact calendar headers */
    .calendar-header {
        padding: 0.6rem 1rem !important;
    }
    
    .month-year {
        font-size: 1.1rem !important;
    }
    
    .week-day-header {
        min-height: 50px !important;
        padding: 0.25rem !important;
    }
    
    .weekday-header {
        padding: 0.5rem !important;
        font-size: 0.75rem !important;
    }
    
    .weekday-name {
        font-size: 0.75rem !important;
    }
    
    .week-day-header .day-number {
        font-size: 1.1rem !important;
    }
    
    /* Most compact weekday header height for responsive row calculation */
    .calendar-grid {
        --weekday-header-height: 40px;
    }
    
    
    .logout-button {
        padding: 0.15rem 0.3rem;
        font-size: 0.7rem;
    }
}

/* Authentication Forms */
.login-container, .register-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-form, .register-form {
    background: #ffffff !important;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 500px;
}

.login-form h2, .register-form h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333333 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif !important;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.login-form .form-group label,
.register-form .form-group label,
.login-form label,
.register-form label {
    color: #333333 !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
}

.form-group input {
    width: 100%;
    padding: var(--control-padding);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.login-form .form-group input,
.register-form .form-group input,
.login-form input[type="text"],
.login-form input[type="email"], 
.login-form input[type="password"],
.login-form input[type="url"],
.register-form input[type="text"],
.register-form input[type="email"],
.register-form input[type="password"],
.register-form input[type="url"] {
    background: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #d1d5db !important;
}

.form-group input:focus {
    outline: none;
    border-color: var(--input-border-focus);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.login-form .form-group input:focus,
.register-form .form-group input:focus,
.login-form input[type="text"]:focus,
.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus,
.login-form input[type="url"]:focus,
.register-form input[type="text"]:focus,
.register-form input[type="email"]:focus,
.register-form input[type="password"]:focus,
.register-form input[type="url"]:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2) !important;
}

.form-group input:disabled {
    background-color: var(--background-tertiary);
    cursor: not-allowed;
}

/* Style date and time picker icons to be theme-aware */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: var(--calendar-picker-filter, none);
    cursor: pointer;
}

/* Firefox date/time picker icon styling */
input[type="date"]::-moz-calendar-picker-indicator,
input[type="time"]::-moz-calendar-picker-indicator,
input[type="datetime-local"]::-moz-calendar-picker-indicator {
    filter: var(--calendar-picker-filter, none);
    cursor: pointer;
}

.input-with-checkbox {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.input-with-checkbox input[type="text"],
.input-with-checkbox input[type="password"] {
    flex: 1;
    min-width: 0;
}

.form-group input {
    width: 100%;
}

.remember-checkbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    opacity: 0.7;
    white-space: nowrap;
    min-width: 80px;
}

.remember-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
    transform: scale(1.1);
}

.remember-checkbox label {
    margin: 0;
    font-size: 0.55rem;
    color: #888888;
    cursor: pointer;
    user-select: none;
    font-weight: 400;
}

.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    padding-right: 3rem !important;
}

.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    z-index: 1;
}

.login-form .password-toggle-btn,
.register-form .password-toggle-btn {
    position: absolute !important;
    right: 0.75rem !important;
    background: transparent !important;
    border: none !important;
    color: #888888 !important;
    cursor: pointer !important;
    padding: 0.25rem !important;
    font-size: 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: color 0.2s ease !important;
    z-index: 1 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.password-toggle-btn:hover {
    color: #555;
}

.login-form .password-toggle-btn:hover,
.register-form .password-toggle-btn:hover {
    color: #555555 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.password-toggle-btn:focus {
    outline: none;
    color: #667eea;
}

.login-form .password-toggle-btn:focus,
.register-form .password-toggle-btn:focus {
    outline: none !important;
    color: #667eea !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.login-button, .register-button {
    width: 100%;
    padding: var(--control-padding);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-button:hover, .register-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.login-button:disabled, .register-button:disabled {
    background: #ccc;
    transform: none;
    cursor: not-allowed;
}

.error-message {
    background-color: var(--error-color);
    color: var(--text-inverse);
    padding: var(--control-padding);
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
}

.login-form .error-message,
.register-form .error-message {
    background-color: #ef4444;
    color: #ffffff;
    border: 1px solid #f5c6cb;
}

.auth-links {
    text-align: center;
    margin-top: 2rem;
    color: #666;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.logout-button {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: var(--control-padding) 1rem;
    border-radius: var(--border-radius-medium);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    width: 100%;
}

.logout-button:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

/* Calendar View */
.calendar-view {
    height: calc(100vh - 4rem); /* Full height minus main padding */
    display: flex;
    flex-direction: column;
}

.calendar-loading, .calendar-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.calendar-loading p {
    font-size: 1.2rem;
    color: #666;
}

.calendar-error p {
    font-size: 1.2rem;
    color: #d32f2f;
}

/* Calendar Component */
.calendar {
    background: var(--calendar-bg, white);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--header-bg, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    color: var(--header-text, white);
}

.month-year {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.time-increment-button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 14px;
    font-weight: bold;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.time-increment-button:hover {
    background: rgba(255,255,255,0.3);
}

.nav-button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.nav-button:hover {
    background: rgba(255,255,255,0.3);
}

.today-button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.today-button:hover {
    background: rgba(255,255,255,0.3);
}

.print-button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.print-button:hover {
    background: rgba(255,255,255,0.3);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    /* grid-template-rows set dynamically in component with calculated weeks */
    position: relative;
    height: calc(100% - var(--calendar-header-height, 88px));
    background: var(--calendar-bg, white);
    gap: 0;
    --weekday-header-height: 50px; /* Base weekday header height */
    --calendar-header-height: 88px; /* Base calendar header height */
}

/* Week View Container */
.week-view-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--calendar-bg, white);
}

/* Week Header */
.week-header {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    background: var(--weekday-header-bg, #f8f9fa);
    border-bottom: 2px solid var(--time-label-border, #e9ecef);
    position: sticky;
    top: 0;
    z-index: 10;
}

.time-gutter {
    background: var(--time-label-bg, #f8f9fa);
    border-right: 1px solid var(--time-label-border, #e9ecef);
}

.week-day-header {
    padding: 0.5rem;
    text-align: center;
    border-right: 1px solid var(--time-label-border, #e9ecef);
    background: var(--weekday-header-bg, #f8f9fa);
    color: var(--weekday-header-text, inherit);
    min-height: 70px; /* Ensure space for all-day events */
    display: flex;
    flex-direction: column;
}

.week-day-header.today {
    background: var(--calendar-today-bg, #e3f2fd);
    color: var(--calendar-today-text, #1976d2);
}

.weekday-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--weekday-header-text, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.week-day-header .day-number {
    font-size: 1.5rem;
    font-weight: 700;
}

.week-day-header.today .weekday-name {
    color: var(--calendar-today-text, #1976d2);
}

/* All-day events in header */
.day-header-content {
    flex-shrink: 0;
}

.all-day-events {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 0.5rem;
    min-height: 0;
}

.all-day-event {
    background: #3B82F6;
    color: white;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    text-align: left;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.2);
    min-height: 18px;
    display: flex;
    align-items: center;
}

.all-day-event:hover {
    filter: brightness(1.1);
}

.all-day-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* Week Content */
.week-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* Allow flex item to shrink below content size */
}

.time-grid {
    display: grid;
    grid-template-columns: 80px 1fr;
    min-height: 1530px; /* 30-minute mode */
}

.time-grid.quarter-mode {
    min-height: 2970px; /* 15-minute mode */
}

/* Time Labels */
.time-labels {
    background: var(--time-label-bg, #f8f9fa);
    border-right: 1px solid var(--time-label-border, #e9ecef);
    position: sticky;
    left: 0;
    z-index: 5;
    min-height: 1530px; /* 30-minute mode */
}

/* Scale time labels container for 15-minute mode */
.time-labels.quarter-mode {
    min-height: 2970px; /* 15-minute mode */
}

/* Default time label height for 30-minute mode */
.time-label {
    height: 60px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--time-label-text, #666);
    border-bottom: 1px solid var(--calendar-border, #f0f0f0);
    font-weight: 500;
}

/* Time label height for 15-minute mode - double height */
.time-label.quarter-mode {
    height: 120px;
}


/* Week Days Grid */
.week-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: 1530px; /* 30-minute mode */
}

.week-days-grid.quarter-mode {
    min-height: 2970px; /* 15-minute mode */
}

.week-day-column {
    position: relative;
    border-right: 1px solid var(--time-label-border, #e9ecef);
    min-height: 1530px; /* 30-minute mode */
}

.week-day-column.quarter-mode {
    min-height: 2970px; /* 15-minute mode */
}

.week-day-column:last-child {
    border-right: none;
}

.week-day-column.today {
    background: var(--calendar-day-hover, #fafffe);
}

/* Time Slots */
.time-slot {
    height: 60px; /* 30-minute mode: 2 slots × 30px = 60px */
    border-bottom: 1px solid var(--calendar-border, #f0f0f0);
    position: relative;
    pointer-events: none; /* Don't capture mouse events */
}

.time-slot.quarter-mode {
    height: 120px; /* 15-minute mode: 4 slots × 30px = 120px */
}

.time-slot-half {
    height: 30px;
    border-bottom: 1px dotted var(--calendar-border, #f5f5f5);
    pointer-events: none; /* Don't capture mouse events */
}

.time-slot-half:last-child {
    border-bottom: none;
}

.time-slot-quarter {
    height: 30px;
    border-bottom: 1px dotted var(--calendar-border-light, #f8f8f8);
    pointer-events: none; /* Don't capture mouse events */
}

.time-slot-quarter:last-child {
    border-bottom: none;
}


/* Events Container */
.events-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none; /* Container doesn't capture, but children (events) do */
    overflow: hidden;
}

/* Week Events */
.week-event {
    position: absolute !important;
    /* left and width are now set inline for overlap handling */
    min-height: 20px;
    background: #3B82F6;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    line-height: 1.3;
    cursor: pointer;
    pointer-events: auto;
    z-index: 3;
    border: 1px solid rgba(255,255,255,0.2);
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Disable pointer events on existing events when creating a new event */
.week-day-column.creating-event .week-event {
    pointer-events: none;
    opacity: 0.6; /* Visual feedback that events are not interactive */
}

.week-day-column.creating-event .week-event .event-content {
    pointer-events: none;
}

.week-day-column.creating-event .week-event .resize-handle {
    pointer-events: none;
}

.week-event:hover {
    filter: brightness(1.1);
    z-index: 4;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.week-event.refreshing {
    animation: pulse 1.5s ease-in-out infinite alternate;
    border-color: #ff9800;
}

/* Temporary event box during drag creation */
.temp-event-box {
    position: absolute;
    left: 4px;
    right: 4px;
    background: rgba(59, 130, 246, 0.3);
    border: 2px dashed rgba(59, 130, 246, 0.8);
    border-radius: 4px;
    color: rgba(59, 130, 246, 0.9);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 6; /* Higher than events */
    text-align: center;
    user-select: none;
}

/* Moving event during drag */
.temp-event-box.moving-event {
    background: inherit; /* Use the event's actual color */
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transform: scale(1.02);
}

.temp-event-box.moving-event .event-title {
    font-weight: 600;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.temp-event-box.moving-event .event-time {
    font-size: 0.65rem;
    opacity: 0.9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* Resizing event during drag */
.temp-event-box.resizing-event {
    background: inherit;
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: white;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transform: scale(1.01);
}

.temp-event-box.resizing-event .event-title {
    font-weight: 600;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.temp-event-box.resizing-event .event-time {
    font-size: 0.65rem;
    opacity: 0.9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* Event resize zones and handles */
/* Remove position: relative to allow absolute positioning for correct event placement */

.week-event .event-content {
    padding: 2px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; /* Center the content horizontally */
    text-align: center; /* Center text within elements */
    pointer-events: auto;
    z-index: 5;
    position: relative;
}

.week-event .event-title-row {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the title and icon */
    gap: 4px;
    width: 100%;
    max-width: 100%;
}

.week-event .event-title {
    flex: 1;
    min-width: 0 !important;
    max-width: calc(100% - 16px) !important; /* This was needed for ellipsis */
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-weight: 600;
    margin-bottom: 2px;
    display: block !important; /* This was also needed */
    text-align: center; /* Center the text within the title element */
}

.week-event .event-reminder-icon {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}

/* Left-click drag handles */
.resize-handle {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: transparent;
    cursor: ns-resize;
    z-index: 10;
    transition: background-color 0.2s;
}

.resize-handle-top {
    top: 0;
    border-top: 2px solid transparent;
}

.resize-handle-bottom {
    bottom: 0;
    border-bottom: 2px solid transparent;
}

.week-event:hover .resize-handle {
    background: var(--glass-bg-lighter);
}

.week-event:hover .resize-handle-top {
    border-top-color: rgba(255, 255, 255, 0.8);
}

.week-event:hover .resize-handle-bottom {
    border-bottom-color: rgba(255, 255, 255, 0.8);
}

.resize-handle:hover {
    background: rgba(255, 255, 255, 0.5) !important;
    border-color: rgba(255, 255, 255, 1) !important;
}


/* Moved to .week-event .event-header .event-title for better specificity */

.week-event .event-time {
    font-size: 0.65rem;
    opacity: 0.9;
    font-weight: 400;
}

.week-event.all-day {
    opacity: 0.9;
    border-left: 4px solid rgba(255,255,255,0.5);
    font-style: italic;
    background: linear-gradient(135deg, var(--event-color, #3B82F6), rgba(255,255,255,0.1)) !important;
}

/* Current Time Indicator */
.current-time-indicator-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 20;
}

.current-time-indicator {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 20;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.current-time-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-color, #667eea);
    position: absolute;
    left: -4px;
    z-index: 21;
    flex-shrink: 0;
}

.current-time-line {
    flex: 1;
    height: 2px;
    background-color: var(--primary-color, #667eea);
    position: relative;
}

.current-time-label {
    position: absolute;
    right: -50px;
    top: -10px;
    background-color: var(--primary-color, #667eea);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Dark theme override for current time indicator */
[data-theme="dark"] .current-time-dot {
    background-color: #9ca3af;
    box-shadow: 0 0 6px rgba(156, 163, 175, 0.4);
}

[data-theme="dark"] .current-time-line {
    background-color: #9ca3af;
    box-shadow: 0 1px 3px rgba(156, 163, 175, 0.3);
}

[data-theme="dark"] .current-time-label {
    background-color: #6b7280;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.4);
}

    z-index: 1000;
}

    max-width: 500px;
    width: 90%;
}

    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
    color: #1f2937;
}

    font-size: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: #4b5563;
    line-height: 1.5;
}

    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    background: #f9fafb;
    border-radius: var(--border-radius-medium);
    padding: 1rem;
}

    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.4;
}

    margin-bottom: 0;
}

    font-size: 0.9rem;
    text-align: center;
    color: #6b7280;
    font-style: italic;
    margin-bottom: 1.5rem;
}

.continue-anyway-button {
    background: var(--primary-color, #667eea);
    color: white;
    border: none;
    padding: var(--control-padding) 1.5rem;
    border-radius: var(--border-radius-medium);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s ease;
}

.continue-anyway-button:hover {
    background: var(--primary-color, #5a6fd8);
}

/* Calendar Management Modal */
.calendar-management-modal {
    max-width: 600px;
    width: 90%;
}

.calendar-management-modal .modal-header {
    padding: 2rem 2.5rem 0;
    border-bottom: none;
    background: var(--modal-header-background);
}

.calendar-management-modal .modal-body {
    padding: 0 2.5rem 2.5rem;
}

.calendar-management-tabs {
    display: flex;
    margin: 1.5rem 0 0 0;
    background: var(--background-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    overflow: hidden;
}

.tab-button {
    flex: 1;
    background: transparent;
    border: none;
    border-right: 1px solid var(--border-primary);
    padding: 1.25rem 2rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    position: relative;
    text-align: center;
}

.tab-button:last-child {
    border-right: none;
}

.tab-button:hover {
    background: var(--background-secondary);
    color: var(--text-primary);
}

.tab-button.active {
    background: var(--background-secondary);
    color: var(--primary-color);
    box-shadow: inset 0 -2px 0 var(--primary-color),
                0 1px 2px rgba(0, 0, 0, 0.05);
}

.calendar-management-modal .modal-body form {
    padding-top: 1rem;
}

/* Generic modal footer for calendar management */
.calendar-management-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 2rem 2.5rem;
    border-top: 1px solid var(--modal-header-border);
    background: var(--modal-header-background);
    margin: 0 -2.5rem -2.5rem;
}

/* Add Calendar Button */
.add-calendar-button {
    background: var(--glass-bg-light);
    border: 1px solid var(--glass-border-light);
    color: white;
    padding: var(--control-padding) 1rem;
    border-radius: var(--border-radius-medium);
    cursor: pointer;
    transition: var(--standard-transition);
    margin-bottom: var(--control-margin);
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    width: 100%;
}

.add-calendar-button:hover {
    background: var(--glass-bg-lighter);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.add-calendar-button:active {
    transform: translateY(0);
}


.weekday-header {
    background: #f8f9fa;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    color: #666;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day {
    border: 1px solid var(--calendar-border, #f0f0f0);
    padding: var(--control-padding);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    overflow: hidden;
    background: var(--calendar-day-bg, white);
}

.calendar-day:hover {
    background-color: var(--calendar-day-hover, #f8f9ff);
}

.calendar-day.current-month {
    background: var(--calendar-day-bg, white);
}

.calendar-day.prev-month,
.calendar-day.next-month {
    background: var(--calendar-day-prev-next, #fafafa);
    color: var(--calendar-day-prev-next-text, #ccc);
}

.calendar-day.today {
    background: var(--calendar-today-bg, #e3f2fd);
    border: 2px solid var(--calendar-today-border, #2196f3);
}

.calendar-day.has-events {
    background: var(--calendar-has-events-bg, #fff3e0);
}

.calendar-day.today.has-events {
    background: var(--calendar-today-bg, #e1f5fe);
}

.calendar-day.selected {
    background: var(--calendar-selected-bg, #e8f5e8);
    border: 2px solid var(--calendar-selected-border, #4caf50);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

.calendar-day.selected.has-events {
    background: var(--calendar-selected-bg, #f1f8e9);
}

.calendar-day.selected.today {
    background: var(--calendar-selected-bg, #e0f2f1);
    border: 2px solid var(--calendar-selected-border, #4caf50);
}

.calendar-day.selected .day-number {
    color: var(--calendar-selected-text, #2e7d32);
    font-weight: 700;
}

.day-number {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.calendar-day.today .day-number {
    color: var(--calendar-today-text, #1976d2);
}

.day-events {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.event-indicators {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.more-events-indicator {
    font-size: 0.7rem;
    color: #666;
    font-weight: 500;
    padding: 2px 4px;
    text-align: center;
    background: #f5f5f5;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.more-events-indicator:hover {
    background: #e0e0e0;
}

.event-box {
    /* Background color will be set inline via style attribute */
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.7rem;
    line-height: 1.2;
    cursor: pointer;
    transition: var(--standard-transition);
    border: 1px solid rgba(255,255,255,0.2);
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    min-width: 0;
}

.event-box:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.event-box.refreshing {
    animation: pulse 1.5s ease-in-out infinite alternate;
    border-color: #ff9800;
}

.event-box.refreshing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 152, 0, 0.3);
    pointer-events: none;
}

@keyframes pulse {
    0% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

.event-dot {
    background: #ff9800;
    height: 6px;
    border-radius: 3px;
    margin-bottom: 1px;
}

.more-events {
    font-size: 0.7rem;
    color: #666;
    margin-top: 2px;
    font-weight: 500;
}

/* Event Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: var(--modal-background);
    color: var(--modal-text);
    border-radius: 6px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12), 
                0 8px 16px rgba(0, 0, 0, 0.08),
                0 0 0 1px rgba(0, 0, 0, 0.04);
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: modalAppear 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 2.5rem;
    border-bottom: 1px solid var(--modal-header-border);
    background: var(--modal-header-background);
}

.modal-header h3 {
    margin: 0;
    color: var(--modal-text);
    font-size: 1.4rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: var(--background-tertiary);
    color: var(--text-primary);
    transform: scale(1.1);
}

.modal-body {
    padding: 0.25rem 1.0rem 0rem;
}

.event-detail {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: start;
}

.event-detail strong {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-detail span {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
    word-break: break-word;
}




/* Create Calendar Button */
.create-calendar-button {
    background: var(--glass-bg-light);
    border: 1px solid var(--glass-bg-lighter);
    color: white;
    padding: var(--control-padding) 1rem;
    border-radius: var(--border-radius-medium);
    cursor: pointer;
    transition: var(--standard-transition);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    width: 100%;
}

.create-calendar-button:hover {
    background: var(--glass-bg-lighter);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.create-calendar-button:active {
    transform: translateY(0);
}

/* View Selector */
.view-selector {
    margin-bottom: 1rem;
}

.view-selector-dropdown {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-bg-light);
    color: white;
    padding: var(--control-padding) 1rem;
    border-radius: var(--border-radius-medium);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--standard-transition);
    backdrop-filter: blur(10px);
}

.view-selector-dropdown:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--glass-bg-lighter);
}

.view-selector-dropdown:focus {
    outline: none;
    background: var(--glass-bg-light);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 2px var(--glass-bg);
}

.view-selector-dropdown option {
    background: #2a2a2a;
    color: white;
    padding: 0.5rem;
}

/* Create Calendar Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.create-calendar-modal {
    background: var(--modal-background);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.create-calendar-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--modal-header-border);
}

.create-calendar-modal .modal-header h2 {
    margin: 0;
    color: var(--modal-text);
    font-size: 1.5rem;
    font-weight: 600;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    border-radius: 4px;
    transition: var(--standard-transition);
}

.close-button:hover {
    color: var(--text-primary);
    background: var(--background-tertiary);
}

.create-calendar-modal .modal-body {
    padding: 1.5rem 2rem 2rem;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    font-size: 0.95rem;
    background: var(--input-background);
    color: var(--input-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    line-height: 1.5;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--input-border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input:disabled,
.form-group textarea:disabled {
    background-color: var(--background-tertiary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.color-option {
    width: 40px;
    height: 40px;
    border: 3px solid transparent;
    border-radius: var(--border-radius-medium);
    cursor: pointer;
    transition: var(--standard-transition);
    position: relative;
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.color-option.selected {
    border-color: #495057;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.color-option.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.color-help-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-primary);
}

.cancel-button,
.create-button {
    padding: 0.875rem 2rem;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    min-width: 120px;
    text-align: center;
}

.cancel-button {
    background: var(--background-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.cancel-button:hover:not(:disabled) {
    background: var(--background-tertiary);
    color: var(--text-primary);
    border-color: var(--border-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.create-button {
    background: var(--button-primary-bg);
    color: var(--button-primary-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.create-button:hover:not(:disabled) {
    background: var(--button-primary-bg);
    filter: brightness(0.9);
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2),
                0 4px 8px rgba(0, 0, 0, 0.08);
}

.cancel-button:disabled,
.create-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.error-message {
    background: var(--error-color);
    color: var(--text-inverse);
    padding: var(--control-padding) 1rem;
    border: 1px solid var(--error-color);
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
}


/* Context Menu */
.context-menu {
    background: var(--modal-background);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 
                0 4px 8px rgba(0, 0, 0, 0.08),
                0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    min-width: 180px;
    overflow: hidden;
    animation: contextMenuSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@keyframes contextMenuSlideIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.context-menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
}

.context-menu-item:first-child {
    margin-top: 0.25rem;
}

.context-menu-item:last-child {
    margin-bottom: 0.25rem;
}

.context-menu-item:hover {
    background: var(--background-tertiary);
    color: var(--text-primary);
    transform: translateX(2px);
}

.context-menu-delete {
    color: #dc2626;
}

.context-menu-delete:hover {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #b91c1c;
}

.context-menu-icon {
    margin-right: 0.75rem;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.context-menu-item:hover .context-menu-icon {
    opacity: 1;
}

/* Prevent text selection on context menu items */
.context-menu-item {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Event Creation Modal Styles */
.create-event-modal {
    min-width: 750px;
    max-width: 900px;
    width: 95%;
}

.create-event-modal .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

.create-event-modal .form-group {
    margin-bottom: 1.5rem;
}

.create-event-modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.create-event-modal .form-input {
    width: 100%;
    padding: var(--control-padding);
    border: 1px solid #ced4da;
    border-radius: var(--border-radius-medium);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.create-event-modal .form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Checkbox specific styling override */
.create-event-modal input[type="checkbox"] {
    width: auto;
    display: inline-block;
    margin-right: 0.5rem;
    vertical-align: middle;
}

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

.create-event-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--modal-header-border);
    background: var(--modal-header-background);
}

/* Button Styles */
.btn {
    padding: var(--control-padding) 1.5rem;
    border-radius: var(--border-radius-medium);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--standard-transition);
    border: none;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    line-height: 1.5;
    user-select: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-secondary {
    background: var(--button-secondary-bg);
    color: var(--button-secondary-text);
    border: 1px solid var(--input-border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--background-tertiary);
    color: var(--text-primary);
    border-color: var(--border-secondary);
}

.btn-primary {
    background: var(--button-primary-bg);
    color: var(--button-primary-text);
    border: 1px solid transparent;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Weekday selection styles */
.weekday-selection {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.weekday-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    transition: var(--standard-transition);
    user-select: none;
    min-width: 3rem;
    justify-content: center;
}

.weekday-checkbox:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.weekday-checkbox input[type="checkbox"] {
    display: none;
}

.weekday-checkbox input[type="checkbox"]:checked + .weekday-label {
    color: white;
}

.weekday-checkbox:has(input[type="checkbox"]:checked) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.weekday-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    transition: color 0.2s ease;
}


/* Recurring Edit Modal */
.recurring-edit-modal {
    max-width: 500px;
    width: 95%;
}

.recurring-edit-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.recurring-option {
    background: var(--input-background);
    border: 2px solid var(--border-primary);
    color: var(--text-secondary);
    padding: 1rem;
    text-align: left;
    border-radius: var(--border-radius-medium);
    cursor: pointer;
    transition: var(--standard-transition);
}

.recurring-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
    color: #495057;
    transform: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.recurring-option .option-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.recurring-option .option-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}


/* Tabbed Modal Interface Styles */
.tab-navigation {
    display: flex;
    border-bottom: 2px solid var(--border-primary);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tab-navigation::-webkit-scrollbar {
    display: none;
}

.tab-button {
    background: none;
    border: none;
    padding: var(--control-padding) 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--standard-transition);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: max-content;
}

.tab-button:hover {
    color: var(--text-primary);
    background: var(--background-secondary);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--background-secondary);
}

.tab-content {
    min-height: 300px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 1rem 2rem 2rem 2rem;
}

.tab-panel {
    animation: fadeIn 0.2s ease-in-out;
}

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


/* Form Help Text and Advanced Info Styles */
.form-help-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    margin-bottom: 0;
    line-height: 1.4;
    font-style: italic;
}

.advanced-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-medium);
    padding: 1rem;
    margin-top: 1.5rem;
}

.advanced-info h5 {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.advanced-info ul {
    margin: 0 0 0.75rem 0;
    padding-left: 1.2rem;
    list-style-type: disc;
}

.advanced-info li {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.advanced-info .form-help-text {
    margin-top: 0.5rem;
    margin-bottom: 0;
    border-top: 1px solid var(--border-primary);
    padding-top: 0.5rem;
}

/* Theme compatibility for advanced info */
[data-theme="dark"] .advanced-info {
    background: #2a2a2a;
    border-color: #444444;
}

[data-theme="dark"] .advanced-info h5 {
    color: #e0e0e0;
}

[data-theme="dark"] .advanced-info li {
    color: #b0b0b0;
}

[data-theme="dark"] .advanced-info .form-help-text {
    border-color: var(--border-primary);
}

/* People Tab Styles */
.people-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-medium);
    padding: 1rem;
    margin-top: 1.5rem;
}

.people-info h5,
.people-info h6 {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.people-info h6 {
    font-size: 0.8rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.people-validation {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-primary);
}

.attendee-roles-preview {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-medium);
    padding: 1rem;
    margin-top: 1rem;
}

.attendee-roles-preview h5 {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.role-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.role-item strong {
    color: #495057;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 140px;
    flex-shrink: 0;
}

.role-item span {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.3;
}

/* Theme compatibility for people info */
[data-theme="dark"] .people-info,
[data-theme="dark"] .attendee-roles-preview {
    background: #2a2a2a;
    border-color: #444444;
}

[data-theme="dark"] .people-info h5,
[data-theme="dark"] .people-info h6,
[data-theme="dark"] .attendee-roles-preview h5 {
    color: #e0e0e0;
}

[data-theme="dark"] .people-validation {
    border-color: #444444;
}

[data-theme="dark"] .role-item {
    background: #1f1f1f;
    border-color: #444444;
}

[data-theme="dark"] .role-item strong {
    color: #e0e0e0;
}

[data-theme="dark"] .role-item span {
    color: #b0b0b0;
}


/* Categories Tab Styles */
.categories-suggestions {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-medium);
    padding: 1rem;
    margin-top: 1.5rem;
}

.categories-suggestions h5 {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.category-tag {
    background: var(--input-background);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--standard-transition);
}

.category-tag:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.categories-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-medium);
    padding: 1rem;
    margin-top: 1rem;
}

.categories-info h5,
.categories-info h6 {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.categories-info h6 {
    font-size: 0.8rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.resources-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-primary);
}

.resource-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.feature-item strong {
    color: #495057;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 140px;
    flex-shrink: 0;
}

.feature-item span {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.3;
}

.quick-actions {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-medium);
    padding: 1rem;
    margin-top: 1rem;
}

.quick-actions h5 {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.action-btn {
    background: #dc3545;
    border: 1px solid #dc3545;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--standard-transition);
}

.action-btn:hover {
    background: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

/* Theme compatibility for categories */
[data-theme="dark"] .categories-suggestions,
[data-theme="dark"] .categories-info,
[data-theme="dark"] .quick-actions {
    background: #2a2a2a;
    border-color: #444444;
}

[data-theme="dark"] .categories-suggestions h5,
[data-theme="dark"] .categories-info h5,
[data-theme="dark"] .categories-info h6,
[data-theme="dark"] .quick-actions h5 {
    color: #e0e0e0;
}

[data-theme="dark"] .category-tag {
    background: #1f1f1f;
    border-color: #667eea;
    color: #667eea;
}

[data-theme="dark"] .category-tag:hover {
    background: #667eea;
    color: white;
}

[data-theme="dark"] .feature-item {
    background: #1f1f1f;
    border-color: #444444;
}

[data-theme="dark"] .feature-item strong {
    color: #e0e0e0;
}

[data-theme="dark"] .feature-item span {
    color: #b0b0b0;
}

[data-theme="dark"] .resources-section {
    border-color: #444444;
}


/* Location Tab Styles */
.location-suggestions {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-medium);
    padding: 1rem;
    margin-top: 1.5rem;
}

.location-suggestions h5 {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.location-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.location-tag {
    background: var(--input-background);
    border: 1px solid var(--success-color);
    color: var(--success-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--standard-transition);
}

.location-tag:hover {
    background: #28a745;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.location-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-medium);
    padding: 1rem;
    margin-top: 1rem;
}

.location-info h5,
.location-info h6 {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.location-info h6 {
    font-size: 0.8rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.geo-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-primary);
}

.geo-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.geo-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.geo-item strong {
    color: #495057;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 120px;
    flex-shrink: 0;
}

.geo-item span {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.3;
}

.location-types {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-medium);
    padding: 1rem;
    margin-top: 1rem;
}

.location-types h5 {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-examples {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.type-category {
    padding: var(--control-padding);
    background: var(--input-background);
    border-radius: 6px;
    border: 1px solid var(--border-primary);
}

.type-category strong {
    display: block;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.type-category ul {
    margin: 0;
    padding-left: 1.2rem;
    list-style-type: disc;
}

.type-category li {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

.action-btn.secondary {
    background: #6c757d;
    border-color: #6c757d;
}

.action-btn.secondary:hover {
    background: #5a6268;
    border-color: #545b62;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.2);
}

/* Theme compatibility for location */
[data-theme="dark"] .location-suggestions,
[data-theme="dark"] .location-info,
[data-theme="dark"] .location-types {
    background: #2a2a2a;
    border-color: #444444;
}

[data-theme="dark"] .location-suggestions h5,
[data-theme="dark"] .location-info h5,
[data-theme="dark"] .location-info h6,
[data-theme="dark"] .location-types h5 {
    color: #e0e0e0;
}

[data-theme="dark"] .location-tag {
    background: #1f1f1f;
    border-color: #28a745;
    color: #28a745;
}

[data-theme="dark"] .location-tag:hover {
    background: #28a745;
    color: white;
}

[data-theme="dark"] .geo-item,
[data-theme="dark"] .type-category {
    background: #1f1f1f;
    border-color: #444444;
}

[data-theme="dark"] .geo-item strong,
[data-theme="dark"] .type-category strong {
    color: #e0e0e0;
}

[data-theme="dark"] .geo-item span {
    color: #b0b0b0;
}

[data-theme="dark"] .type-category li {
    color: #b0b0b0;
    background: #2a2a2a;
}

[data-theme="dark"] .geo-section {
    border-color: #444444;
}


/* Reminders & Attachments Tab Styles */
.reminder-types {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-medium);
    padding: 1rem;
    margin-top: 1.5rem;
}

.reminder-types h5 {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alarm-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.alarm-type {
    padding: var(--control-padding);
    background: var(--input-background);
    border-radius: 6px;
    border: 1px solid var(--border-primary);
    text-align: center;
}

.alarm-type strong {
    display: block;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.alarm-type p {
    color: #6c757d;
    font-size: 0.8rem;
    margin: 0;
    line-height: 1.3;
}

.reminder-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-medium);
    padding: 1rem;
    margin-top: 1rem;
}

.reminder-info h5,
.reminder-info h6 {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reminder-info h6 {
    font-size: 0.8rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.attachments-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-primary);
}

.attachment-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.attachment-type {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.attachment-type strong {
    color: #495057;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 120px;
    flex-shrink: 0;
}

.attachment-type span {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.3;
}

.reminder-patterns {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius-medium);
    padding: 1rem;
    margin-top: 1rem;
}

.reminder-patterns h5 {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pattern-examples {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.pattern-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.pattern-item strong {
    color: #495057;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 100px;
    flex-shrink: 0;
}

.pattern-item span {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.3;
}

.action-btn.tertiary {
    background: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.action-btn.tertiary:hover {
    background: #138496;
    border-color: #117a8b;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.2);
}

.completion-status {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius-medium);
    padding: 1.5rem;
    margin-top: 2rem;
    text-align: center;
}

.completion-status h5 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.completion-status p {
    margin: 0 0 1rem 0;
    opacity: 0.9;
    line-height: 1.5;
}

.feature-summary {
    background: var(--glass-bg);
    border-radius: 6px;
    padding: 1rem;
    margin-top: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--glass-bg);
}

.summary-row:last-child {
    border-bottom: none;
}

.tab-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.tab-desc {
    font-size: 0.8rem;
    opacity: 0.8;
    text-align: right;
    max-width: 60%;
}

/* Theme compatibility for reminders */
[data-theme="dark"] .reminder-types,
[data-theme="dark"] .reminder-info,
[data-theme="dark"] .reminder-patterns {
    background: #2a2a2a;
    border-color: #444444;
}

[data-theme="dark"] .reminder-types h5,
[data-theme="dark"] .reminder-info h5,
[data-theme="dark"] .reminder-info h6,
[data-theme="dark"] .reminder-patterns h5 {
    color: #e0e0e0;
}

[data-theme="dark"] .alarm-type,
[data-theme="dark"] .attachment-type,
[data-theme="dark"] .pattern-item {
    background: #1f1f1f;
    border-color: #444444;
}

[data-theme="dark"] .alarm-type strong,
[data-theme="dark"] .attachment-type strong,
[data-theme="dark"] .pattern-item strong {
    color: #e0e0e0;
}

[data-theme="dark"] .alarm-type p,
[data-theme="dark"] .attachment-type span,
[data-theme="dark"] .pattern-item span {
    color: #b0b0b0;
}

[data-theme="dark"] .attachments-section {
    border-color: #444444;
}


/* Theme Selector Styles */
.theme-selector {
    margin-bottom: 1rem;
}

.theme-selector-dropdown {
    width: 100%;
    padding: var(--control-padding) 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-bg-light);
    border-radius: var(--border-radius-medium);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--standard-transition);
}

.theme-selector-dropdown:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--glass-bg-lighter);
}

.theme-selector-dropdown:focus {
    outline: none;
    background: var(--glass-bg-light);
    border-color: rgba(255, 255, 255, 0.4);
}

.theme-selector-dropdown option {
    background: #333;
    color: white;
    padding: 0.5rem;
}

/* Style Selector Styles */
.style-selector {
    margin-bottom: 1rem;
}

.style-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.8);
}

.style-selector-dropdown {
    width: 100%;
    padding: var(--control-padding) 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-bg-light);
    border-radius: var(--border-radius-medium);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--standard-transition);
}

.style-selector-dropdown:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--glass-bg-lighter);
}

.style-selector-dropdown:focus {
    outline: none;
    background: var(--glass-bg-light);
    border-color: rgba(255, 255, 255, 0.4);
}

.style-selector-dropdown option {
    background: #333;
    color: white;
    padding: 0.5rem;
}

/* Theme Definitions */
:root {
    /* Default Theme */
    --primary-gradient: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    --primary-bg: #f8f9fa;
    --primary-text: #333;
    --sidebar-bg: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    --sidebar-text: white;
    --header-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --header-text: white;
    --card-bg: white;
    --border-color: #e9ecef;
    --accent-color: #667eea;
    --calendar-bg: white;
    --calendar-border: #f0f0f0;
    --calendar-border-light: #f8f8f8;
    --calendar-day-bg: white;
    --calendar-day-hover: #f8f9ff;
    --calendar-day-prev-next: #fafafa;
    --calendar-day-prev-next-text: #ccc;
    --calendar-today-bg: #e3f2fd;
    --calendar-today-border: #2196f3;
    --calendar-today-text: #1976d2;
    --calendar-selected-bg: #e8f5e8;
    --calendar-selected-border: #4caf50;
    --calendar-selected-text: #2e7d32;
    --calendar-has-events-bg: #fff3e0;
    --weekday-header-bg: #f8f9fa;
    --weekday-header-text: #666;
    --time-label-bg: #f8f9fa;
    --time-label-text: #666;
    --time-label-border: #e9ecef;
    --event-colors: #3B82F6, #10B981, #F59E0B, #EF4444, #8B5CF6, #06B6D4, #84CC16, #F97316, #EC4899, #6366F1, #14B8A6, #F3B806, #8B5A2B, #6B7280, #DC2626, #7C3AED;
}

/* Ocean Theme */
[data-theme="ocean"] {
    --primary-gradient: linear-gradient(180deg, #2196F3 0%, #0277BD 100%);
    --primary-bg: #e3f2fd;
    --primary-text: #0d47a1;
    --sidebar-bg: linear-gradient(180deg, #2196F3 0%, #0277BD 100%);
    --sidebar-text: white;
    --header-bg: linear-gradient(135deg, #2196F3 0%, #0277BD 100%);
    --header-text: white;
    --card-bg: #ffffff;
    --border-color: #bbdefb;
    --accent-color: #2196F3;
    --calendar-bg: #ffffff;
    --calendar-border: #bbdefb;
    --calendar-border-light: #e3f2fd;
    --calendar-day-bg: #ffffff;
    --calendar-day-hover: #e1f5fe;
    --calendar-day-prev-next: #f3f8ff;
    --calendar-day-prev-next-text: #90caf9;
    --calendar-today-bg: #b3e5fc;
    --calendar-today-border: #0277BD;
    --calendar-today-text: #01579b;
    --calendar-selected-bg: #e0f7fa;
    --calendar-selected-border: #00acc1;
    --calendar-selected-text: #00695c;
    --calendar-has-events-bg: #fff8e1;
    --weekday-header-bg: #e3f2fd;
    --weekday-header-text: #0d47a1;
    --time-label-bg: #e3f2fd;
    --time-label-text: #0d47a1;
    --time-label-border: #bbdefb;
    --event-colors: #2196F3, #03DAC6, #FF9800, #F44336, #9C27B0, #00BCD4, #8BC34A, #FF5722, #E91E63, #3F51B5, #009688, #FFC107, #607D8B, #795548, #E53935, #673AB7;
}

[data-theme="ocean"] body {
    background-color: var(--primary-bg);
    color: var(--primary-text);
}

[data-theme="ocean"] .app-sidebar {
    background: var(--sidebar-bg);
}

/* Forest Theme */
[data-theme="forest"] {
    --primary-gradient: linear-gradient(180deg, #4CAF50 0%, #2E7D32 100%);
    --primary-bg: #e8f5e8;
    --primary-text: #1b5e20;
    --sidebar-bg: linear-gradient(180deg, #4CAF50 0%, #2E7D32 100%);
    --sidebar-text: white;
    --header-bg: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    --header-text: white;
    --card-bg: #ffffff;
    --border-color: #c8e6c9;
    --accent-color: #4CAF50;
    --calendar-bg: #ffffff;
    --calendar-border: #c8e6c9;
    --calendar-border-light: #e8f5e8;
    --calendar-day-bg: #ffffff;
    --calendar-day-hover: #f1f8e9;
    --calendar-day-prev-next: #f9fbe7;
    --calendar-day-prev-next-text: #a5d6a7;
    --calendar-today-bg: #c8e6c9;
    --calendar-today-border: #2E7D32;
    --calendar-today-text: #1b5e20;
    --calendar-selected-bg: #e8f5e8;
    --calendar-selected-border: #388e3c;
    --calendar-selected-text: #2e7d32;
    --calendar-has-events-bg: #fff3e0;
    --weekday-header-bg: #e8f5e8;
    --weekday-header-text: #1b5e20;
    --time-label-bg: #e8f5e8;
    --time-label-text: #1b5e20;
    --time-label-border: #c8e6c9;
    --event-colors: #4CAF50, #8BC34A, #FF9800, #FF5722, #9C27B0, #03DAC6, #CDDC39, #FF6F00, #E91E63, #3F51B5, #009688, #FFC107, #795548, #607D8B, #F44336, #673AB7;
}

[data-theme="forest"] body {
    background-color: var(--primary-bg);
    color: var(--primary-text);
}

[data-theme="forest"] .app-sidebar {
    background: var(--sidebar-bg);
}

/* Sunset Theme */
[data-theme="sunset"] {
    --primary-gradient: linear-gradient(180deg, #FF9800 0%, #F57C00 100%);
    --primary-bg: #fff3e0;
    --primary-text: #e65100;
    --sidebar-bg: linear-gradient(180deg, #FF9800 0%, #F57C00 100%);
    --sidebar-text: white;
    --header-bg: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    --header-text: white;
    --card-bg: #ffffff;
    --border-color: #ffcc02;
    --accent-color: #FF9800;
    --calendar-bg: #ffffff;
    --calendar-border: #ffe0b2;
    --calendar-border-light: #fff3e0;
    --calendar-day-bg: #ffffff;
    --calendar-day-hover: #fff8e1;
    --calendar-day-prev-next: #fffde7;
    --calendar-day-prev-next-text: #ffcc02;
    --calendar-today-bg: #ffe0b2;
    --calendar-today-border: #F57C00;
    --calendar-today-text: #e65100;
    --calendar-selected-bg: #fff3e0;
    --calendar-selected-border: #ff8f00;
    --calendar-selected-text: #ff6f00;
    --calendar-has-events-bg: #f3e5f5;
    --weekday-header-bg: #fff3e0;
    --weekday-header-text: #e65100;
    --time-label-bg: #fff3e0;
    --time-label-text: #e65100;
    --time-label-border: #ffe0b2;
    --event-colors: #FF9800, #FF5722, #F44336, #E91E63, #9C27B0, #673AB7, #3F51B5, #2196F3, #03DAC6, #009688, #4CAF50, #8BC34A, #CDDC39, #FFC107, #FF6F00, #795548;
}

[data-theme="sunset"] body {
    background-color: var(--primary-bg);
    color: var(--primary-text);
}

[data-theme="sunset"] .app-sidebar {
    background: var(--sidebar-bg);
}

/* Purple Theme */
[data-theme="purple"] {
    --primary-gradient: linear-gradient(180deg, #9C27B0 0%, #6A1B9A 100%);
    --primary-bg: #f3e5f5;
    --primary-text: #4a148c;
    --sidebar-bg: linear-gradient(180deg, #9C27B0 0%, #6A1B9A 100%);
    --sidebar-text: white;
    --header-bg: linear-gradient(135deg, #9C27B0 0%, #6A1B9A 100%);
    --header-text: white;
    --card-bg: #ffffff;
    --border-color: #ce93d8;
    --accent-color: #9C27B0;
    --calendar-bg: #ffffff;
    --calendar-border: #ce93d8;
    --calendar-border-light: #f3e5f5;
    --calendar-day-bg: #ffffff;
    --calendar-day-hover: #f8e9fc;
    --calendar-day-prev-next: #fce4ec;
    --calendar-day-prev-next-text: #ce93d8;
    --calendar-today-bg: #e1bee7;
    --calendar-today-border: #6A1B9A;
    --calendar-today-text: #4a148c;
    --calendar-selected-bg: #f3e5f5;
    --calendar-selected-border: #8e24aa;
    --calendar-selected-text: #6a1b9a;
    --calendar-has-events-bg: #fff3e0;
    --weekday-header-bg: #f3e5f5;
    --weekday-header-text: #4a148c;
    --time-label-bg: #f3e5f5;
    --time-label-text: #4a148c;
    --time-label-border: #ce93d8;
    --event-colors: #9C27B0, #673AB7, #3F51B5, #2196F3, #03DAC6, #009688, #4CAF50, #8BC34A, #CDDC39, #FFC107, #FF9800, #FF5722, #F44336, #E91E63, #795548, #607D8B;
}

[data-theme="purple"] body {
    background-color: var(--primary-bg);
    color: var(--primary-text);
}

[data-theme="purple"] .app-sidebar {
    background: var(--sidebar-bg);
}

/* Dark Theme */
[data-theme="dark"] {
    --primary-gradient: linear-gradient(180deg, #424242 0%, #212121 100%);
    --primary-bg: #121212;
    --primary-text: #ffffff;
    --sidebar-bg: linear-gradient(180deg, #424242 0%, #212121 100%);
    --sidebar-text: white;
    --header-bg: linear-gradient(135deg, #424242 0%, #212121 100%);
    --header-text: white;
    --card-bg: #1e1e1e;
    --border-color: #333333;
    --accent-color: #666666;
    --calendar-bg: #1f1f1f;
    --calendar-border: #333333;
    --calendar-border-light: #2a2a2a;
    --calendar-day-bg: #1f1f1f;
    --calendar-day-hover: #2a2a2a;
    --calendar-day-prev-next: #1a1a1a;
    --calendar-day-prev-next-text: #555;
    --calendar-today-bg: #2d2d2d;
    --calendar-today-border: #bb86fc;
    --calendar-today-text: #bb86fc;
    --calendar-selected-bg: #2a2a2a;
    --calendar-selected-border: #bb86fc;
    --calendar-selected-text: #bb86fc;
    --calendar-has-events-bg: #272727;
    --weekday-header-bg: #1a1a1a;
    --weekday-header-text: #e0e0e0;
    --time-label-bg: #1a1a1a;
    --time-label-text: #e0e0e0;
    --time-label-border: #333333;
    --event-colors: #bb86fc, #03dac6, #cf6679, #ff9800, #4caf50, #2196f3, #9c27b0, #f44336, #795548, #607d8b, #e91e63, #3f51b5, #009688, #8bc34a, #ffc107, #ff5722;
}

[data-theme="dark"] body {
    background-color: var(--primary-bg);
    color: var(--primary-text);
}

[data-theme="dark"] .app-sidebar {
    background: var(--sidebar-bg);
}

[data-theme="dark"] .app-main {
    background-color: var(--primary-bg);
}

[data-theme="dark"] .calendar-day {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--primary-text);
}

/* Rose Theme */
[data-theme="rose"] {
    --primary-gradient: linear-gradient(180deg, #E91E63 0%, #AD1457 100%);
    --primary-bg: #fce4ec;
    --primary-text: #880e4f;
    --sidebar-bg: linear-gradient(180deg, #E91E63 0%, #AD1457 100%);
    --sidebar-text: white;
    --header-bg: linear-gradient(135deg, #E91E63 0%, #AD1457 100%);
    --header-text: white;
    --card-bg: #ffffff;
    --border-color: #f8bbd9;
    --accent-color: #E91E63;
    --calendar-bg: #ffffff;
    --calendar-border: #f8bbd9;
    --calendar-border-light: #fce4ec;
    --calendar-day-bg: #ffffff;
    --calendar-day-hover: #fdf2f8;
    --calendar-day-prev-next: #fef7ff;
    --calendar-day-prev-next-text: #f8bbd9;
    --calendar-today-bg: #f48fb1;
    --calendar-today-border: #AD1457;
    --calendar-today-text: #880e4f;
    --calendar-selected-bg: #fce4ec;
    --calendar-selected-border: #c2185b;
    --calendar-selected-text: #ad1457;
    --calendar-has-events-bg: #fff3e0;
    --weekday-header-bg: #fce4ec;
    --weekday-header-text: #880e4f;
    --time-label-bg: #fce4ec;
    --time-label-text: #880e4f;
    --time-label-border: #f8bbd9;
    --event-colors: #E91E63, #9C27B0, #673AB7, #3F51B5, #2196F3, #03DAC6, #009688, #4CAF50, #8BC34A, #CDDC39, #FFC107, #FF9800, #FF5722, #F44336, #795548, #607D8B;
}

[data-theme="rose"] body {
    background-color: var(--primary-bg);
    color: var(--primary-text);
}

[data-theme="rose"] .app-sidebar {
    background: var(--sidebar-bg);
}

/* Mint Theme */
[data-theme="mint"] {
    --primary-gradient: linear-gradient(180deg, #26A69A 0%, #00695C 100%);
    --primary-bg: #e0f2f1;
    --primary-text: #004d40;
    --sidebar-bg: linear-gradient(180deg, #26A69A 0%, #00695C 100%);
    --sidebar-text: white;
    --header-bg: linear-gradient(135deg, #26A69A 0%, #00695C 100%);
    --header-text: white;
    --card-bg: #ffffff;
    --border-color: #b2dfdb;
    --accent-color: #26A69A;
    --calendar-bg: #ffffff;
    --calendar-border: #b2dfdb;
    --calendar-border-light: #e0f2f1;
    --calendar-day-bg: #ffffff;
    --calendar-day-hover: #f0fdfc;
    --calendar-day-prev-next: #f7ffff;
    --calendar-day-prev-next-text: #b2dfdb;
    --calendar-today-bg: #b2dfdb;
    --calendar-today-border: #00695C;
    --calendar-today-text: #004d40;
    --calendar-selected-bg: #e0f2f1;
    --calendar-selected-border: #00897b;
    --calendar-selected-text: #00695c;
    --calendar-has-events-bg: #fff3e0;
    --weekday-header-bg: #e0f2f1;
    --weekday-header-text: #004d40;
    --time-label-bg: #e0f2f1;
    --time-label-text: #004d40;
    --time-label-border: #b2dfdb;
    --event-colors: #26A69A, #009688, #4CAF50, #8BC34A, #CDDC39, #FFC107, #FF9800, #FF5722, #F44336, #E91E63, #9C27B0, #673AB7, #3F51B5, #2196F3, #795548, #607D8B;
}

[data-theme="mint"] body {
    background-color: var(--primary-bg);
    color: var(--primary-text);
}

[data-theme="mint"] .app-sidebar {
    background: var(--sidebar-bg);
}

/* Midnight Theme - Deep blue-black with blue accents */
[data-theme="midnight"] {
    --primary-gradient: linear-gradient(180deg, #0f1419 0%, #151b26 100%);
    --primary-bg: #0a0e13;
    --primary-text: #e6e6e6;
    --sidebar-bg: linear-gradient(180deg, #1a1f2e 0%, #252b3a 100%);
    --sidebar-text: #e6e6e6;
    --header-bg: linear-gradient(135deg, #1a1f2e 0%, #252b3a 100%);
    --header-text: #e6e6e6;
    --card-bg: #151b26;
    --border-color: #2d3648;
    --accent-color: #4c9aff;
    --calendar-bg: #151b26;
    --calendar-border: #2d3648;
    --calendar-border-light: #1f2937;
    --calendar-day-bg: #151b26;
    --calendar-day-hover: #1f2937;
    --calendar-day-prev-next: #0f1419;
    --calendar-day-prev-next-text: #4a5568;
    --calendar-today-bg: #1e3a8a;
    --calendar-today-border: #4c9aff;
    --calendar-today-text: #93c5fd;
    --calendar-selected-bg: #1f2937;
    --calendar-selected-border: #4c9aff;
    --calendar-selected-text: #93c5fd;
    --calendar-has-events-bg: #1a202c;
    --weekday-header-bg: #0f1419;
    --weekday-header-text: #a0aec0;
    --time-label-bg: #0f1419;
    --time-label-text: #a0aec0;
    --time-label-border: #2d3648;
    --event-colors: #4c9aff, #00d4aa, #ffa726, #ff5722, #ab47bc, #26c6da, #66bb6a, #ef5350, #ec407a, #7e57c2, #42a5f5, #ffca28, #78909c, #8d6e63, #ff7043, #5c6bc0;
    
    /* Dark Theme CSS Variables */
    --background-primary: #0a0e13;
    --background-secondary: #151b26;
    --background-tertiary: #1f2937;
    --text-primary: #e6e6e6;
    --text-secondary: #a0aec0;
    --text-inverse: #0a0e13;
    --border-primary: #2d3648;
    --border-secondary: #374151;
    --border-light: #4a5568;
    --modal-background: #151b26;
    --modal-text: #e6e6e6;
    --modal-header-background: #151b26;
    --modal-header-border: #2d3648;
    --button-primary-bg: #4c9aff;
    --button-primary-text: #ffffff;
    --input-background: #1f2937;
    --input-border: #374151;
    --input-border-focus: #4c9aff;
    --input-text: #e6e6e6;
}

[data-theme="midnight"] body {
    background-color: var(--primary-bg);
    color: var(--primary-text);
}

[data-theme="midnight"] .app-sidebar {
    background: var(--sidebar-bg);
}

[data-theme="midnight"] .app-main {
    background-color: var(--primary-bg);
}

[data-theme="midnight"] .calendar-day {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--primary-text);
}

/* Charcoal Theme - Pure dark grays with subtle colored accents */
[data-theme="charcoal"] {
    --primary-gradient: linear-gradient(180deg, #1a1a1a 0%, #2a2a2a 100%);
    --primary-bg: #0d0d0d;
    --primary-text: #f0f0f0;
    --sidebar-bg: linear-gradient(180deg, #262626 0%, #333333 100%);
    --sidebar-text: #f0f0f0;
    --header-bg: linear-gradient(135deg, #262626 0%, #333333 100%);
    --header-text: #f0f0f0;
    --card-bg: #1a1a1a;
    --border-color: #404040;
    --accent-color: #4ade80;
    --calendar-bg: #1a1a1a;
    --calendar-border: #404040;
    --calendar-border-light: #262626;
    --calendar-day-bg: #1a1a1a;
    --calendar-day-hover: #262626;
    --calendar-day-prev-next: #0d0d0d;
    --calendar-day-prev-next-text: #595959;
    --calendar-today-bg: #166534;
    --calendar-today-border: #4ade80;
    --calendar-today-text: #86efac;
    --calendar-selected-bg: #262626;
    --calendar-selected-border: #4ade80;
    --calendar-selected-text: #86efac;
    --calendar-has-events-bg: #1f1f1f;
    --weekday-header-bg: #0d0d0d;
    --weekday-header-text: #a6a6a6;
    --time-label-bg: #0d0d0d;
    --time-label-text: #a6a6a6;
    --time-label-border: #404040;
    --event-colors: #4ade80, #06b6d4, #a855f7, #f59e0b, #ef4444, #ec4899, #8b5cf6, #10b981, #3b82f6, #f97316, #84cc16, #6366f1, #14b8a6, #f43f5e, #64748b, #71717a;
    
    /* Dark Theme CSS Variables */
    --background-primary: #0d0d0d;
    --background-secondary: #1a1a1a;
    --background-tertiary: #262626;
    --text-primary: #f0f0f0;
    --text-secondary: #a6a6a6;
    --text-inverse: #0d0d0d;
    --border-primary: #404040;
    --border-secondary: #525252;
    --border-light: #595959;
    --modal-background: #1a1a1a;
    --modal-text: #f0f0f0;
    --modal-header-background: #1a1a1a;
    --modal-header-border: #404040;
    --button-primary-bg: #4ade80;
    --button-primary-text: #0d0d0d;
    --input-background: #262626;
    --input-border: #404040;
    --input-border-focus: #4ade80;
    --input-text: #f0f0f0;
}

[data-theme="charcoal"] body {
    background-color: var(--primary-bg);
    color: var(--primary-text);
}

[data-theme="charcoal"] .app-sidebar {
    background: var(--sidebar-bg);
}

[data-theme="charcoal"] .app-main {
    background-color: var(--primary-bg);
}

[data-theme="charcoal"] .calendar-day {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--primary-text);
}

/* Nord Theme - Nordic-inspired dark theme */
[data-theme="nord"] {
    --primary-gradient: linear-gradient(180deg, #2e3440 0%, #3b4252 100%);
    --primary-bg: #2e3440;
    --primary-text: #eceff4;
    --sidebar-bg: linear-gradient(180deg, #434c5e 0%, #4c566a 100%);
    --sidebar-text: #eceff4;
    --header-bg: linear-gradient(135deg, #434c5e 0%, #4c566a 100%);
    --header-text: #eceff4;
    --card-bg: #3b4252;
    --border-color: #4c566a;
    --accent-color: #88c0d0;
    --calendar-bg: #3b4252;
    --calendar-border: #4c566a;
    --calendar-border-light: #434c5e;
    --calendar-day-bg: #3b4252;
    --calendar-day-hover: #434c5e;
    --calendar-day-prev-next: #2e3440;
    --calendar-day-prev-next-text: #5e81ac;
    --calendar-today-bg: #5e81ac;
    --calendar-today-border: #88c0d0;
    --calendar-today-text: #d8dee9;
    --calendar-selected-bg: #434c5e;
    --calendar-selected-border: #88c0d0;
    --calendar-selected-text: #d8dee9;
    --calendar-has-events-bg: #3b4252;
    --weekday-header-bg: #2e3440;
    --weekday-header-text: #d8dee9;
    --time-label-bg: #2e3440;
    --time-label-text: #d8dee9;
    --time-label-border: #4c566a;
    --event-colors: #88c0d0, #81a1c1, #5e81ac, #bf616a, #d08770, #ebcb8b, #a3be8c, #b48ead, #8fbcbb, #5e81ac, #88c0d0, #81a1c1, #bf616a, #d08770, #ebcb8b, #a3be8c;
    
    /* Dark Theme CSS Variables */
    --background-primary: #2e3440;
    --background-secondary: #3b4252;
    --background-tertiary: #434c5e;
    --text-primary: #eceff4;
    --text-secondary: #d8dee9;
    --text-inverse: #2e3440;
    --border-primary: #4c566a;
    --border-secondary: #5e81ac;
    --border-light: #81a1c1;
    --modal-background: #3b4252;
    --modal-text: #eceff4;
    --modal-header-background: #3b4252;
    --modal-header-border: #4c566a;
    --button-primary-bg: #88c0d0;
    --button-primary-text: #2e3440;
    --input-background: #434c5e;
    --input-border: #4c566a;
    --input-border-focus: #88c0d0;
    --input-text: #eceff4;
}

[data-theme="nord"] body {
    background-color: var(--primary-bg);
    color: var(--primary-text);
}

[data-theme="nord"] .app-sidebar {
    background: var(--sidebar-bg);
}

[data-theme="nord"] .app-main {
    background-color: var(--primary-bg);
}

[data-theme="nord"] .calendar-day {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--primary-text);
}

/* Dracula Theme - Popular developer dark theme */
[data-theme="dracula"] {
    --primary-gradient: linear-gradient(180deg, #282a36 0%, #44475a 100%);
    --primary-bg: #282a36;
    --primary-text: #f8f8f2;
    --sidebar-bg: linear-gradient(180deg, #44475a 0%, #6272a4 100%);
    --sidebar-text: #f8f8f2;
    --header-bg: linear-gradient(135deg, #44475a 0%, #6272a4 100%);
    --header-text: #f8f8f2;
    --card-bg: #44475a;
    --border-color: #6272a4;
    --accent-color: #bd93f9;
    --calendar-bg: #44475a;
    --calendar-border: #6272a4;
    --calendar-border-light: #6272a4;
    --calendar-day-bg: #44475a;
    --calendar-day-hover: #6272a4;
    --calendar-day-prev-next: #282a36;
    --calendar-day-prev-next-text: #6272a4;
    --calendar-today-bg: #bd93f9;
    --calendar-today-border: #ff79c6;
    --calendar-today-text: #282a36;
    --calendar-selected-bg: #6272a4;
    --calendar-selected-border: #bd93f9;
    --calendar-selected-text: #f8f8f2;
    --calendar-has-events-bg: #44475a;
    --weekday-header-bg: #282a36;
    --weekday-header-text: #f8f8f2;
    --time-label-bg: #282a36;
    --time-label-text: #f8f8f2;
    --time-label-border: #6272a4;
    --event-colors: #bd93f9, #ff79c6, #8be9fd, #50fa7b, #ffb86c, #ff5555, #f1fa8c, #6272a4, #ff79c6, #bd93f9, #8be9fd, #50fa7b, #ffb86c, #ff5555, #f1fa8c, #6272a4;
    
    /* Dark Theme CSS Variables */
    --background-primary: #282a36;
    --background-secondary: #44475a;
    --background-tertiary: #6272a4;
    --text-primary: #f8f8f2;
    --text-secondary: #f8f8f2;
    --text-inverse: #282a36;
    --border-primary: #6272a4;
    --border-secondary: #bd93f9;
    --border-light: #ff79c6;
    --modal-background: #44475a;
    --modal-text: #f8f8f2;
    --modal-header-background: #44475a;
    --modal-header-border: #6272a4;
    --button-primary-bg: #bd93f9;
    --button-primary-text: #282a36;
    --input-background: #6272a4;
    --input-border: #bd93f9;
    --input-border-focus: #ff79c6;
    --input-text: #f8f8f2;
}

[data-theme="dracula"] body {
    background-color: var(--primary-bg);
    color: var(--primary-text);
}

[data-theme="dracula"] .app-sidebar {
    background: var(--sidebar-bg);
}

[data-theme="dracula"] .app-main {
    background-color: var(--primary-bg);
}

[data-theme="dracula"] .calendar-day {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--primary-text);
}

/* Recurrence Options Styling */
.recurrence-options {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--background-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius-medium);
}

.interval-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.interval-input input {
    width: 80px;
    flex-shrink: 0;
}

.interval-unit {
    color: #6c757d;
    font-size: 0.9rem;
}

.end-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.end-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.end-option .radio-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.5rem;
    white-space: nowrap;
    cursor: pointer;
}

.end-option input[type="date"],
.end-option input[type="number"] {
    width: 120px;
}

.count-input {
    width: 80px !important;
}

.count-unit {
    color: #6c757d;
    font-size: 0.9rem;
}

.monthly-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.monthly-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.monthly-option .radio-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.5rem;
    white-space: nowrap;
    cursor: pointer;
}

.day-input {
    width: 80px !important;
}

.yearly-months {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.month-checkbox {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--standard-transition);
}

.month-checkbox:hover {
    background-color: #f8f9fa;
    border-color: #ced4da;
}

.month-checkbox input[type="checkbox"] {
    width: auto !important;
    margin: 0 !important;
}

.month-label {
    font-size: 0.9rem;
    user-select: none;
}

/* Radio button styling */
.radio-label input[type="radio"] {
    width: auto !important;
    margin: 0 !important;
    margin-right: 0.25rem !important;
}


/* ==================== EXTERNAL CALENDARS STYLES ==================== */

/* External Calendar Section in Sidebar */
.external-calendar-list {
    margin-bottom: 2px;
}

.external-calendar-list h3 {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-left: 0.5rem;
}

.external-calendar-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.external-calendar-item {
    margin-bottom: 0.5rem;
}

.external-calendar-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: var(--control-padding-sm);
    border-radius: var(--border-radius-medium);
    transition: var(--standard-transition);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-bg);
}

.external-calendar-info:hover:not(.color-picker-active) {
    background: var(--glass-bg);
    border-color: var(--glass-bg-light);
    transform: translateX(2px);
}



.external-calendar-info input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 16px;
    height: 16px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.external-calendar-info input[type="checkbox"]:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.external-calendar-info input[type="checkbox"]:checked {
    border-color: rgba(255, 255, 255, 0.6);
}

.external-calendar-info input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}

.external-calendar-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--glass-bg-lighter);
    flex-shrink: 0;
}

.external-calendar-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.external-calendar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.last-updated {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    opacity: 0.8;
}

.external-calendar-refresh-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 4px;
    border-radius: 3px;
    transition: var(--standard-transition);
    line-height: 1;
}

.external-calendar-refresh-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: var(--glass-bg);
    transform: rotate(180deg);
}

.external-calendar-indicator {
    font-size: 0.8rem;
    opacity: 0.7;
    flex-shrink: 0;
}

/* CalDAV Calendar Styles */
.calendar-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: var(--control-padding-sm);
    border-radius: var(--border-radius-medium);
    transition: var(--standard-transition);
    cursor: pointer;
}

.calendar-info:hover {
    background: var(--glass-bg);
    transform: translateX(2px);
}

.calendar-info input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 16px;
    height: 16px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.calendar-info input[type="checkbox"]:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.calendar-info input[type="checkbox"]:checked {
    border-color: rgba(255, 255, 255, 0.6);
}

.calendar-info input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}

/* Create External Calendar Button */
.create-external-calendar-button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.9);
    padding: var(--control-padding) 1rem;
    border-radius: var(--border-radius-medium);
    cursor: pointer;
    transition: var(--standard-transition);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    width: 100%;
    position: relative;
}

.create-external-calendar-button::before {
    content: "";
    position: absolute;
    left: 1rem;
    font-size: 0.8rem;
    opacity: 0.8;
}

.create-external-calendar-button {
    padding-left: 2.5rem;
}

.create-external-calendar-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.create-external-calendar-button:active {
    transform: translateY(0);
}

/* External Calendar Modal */
.external-calendar-modal {
    background: var(--modal-background);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

.external-calendar-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--modal-header-border);
}

.external-calendar-modal .modal-header h3 {
    margin: 0;
    color: var(--modal-text);
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.external-calendar-modal .modal-header h3::before {
    content: "📅";
    font-size: 1.2rem;
    opacity: 0.8;
}

.external-calendar-modal .modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--standard-transition);
}

.external-calendar-modal .modal-close:hover {
    background: var(--background-tertiary);
    color: var(--text-primary);
}

.external-calendar-modal .modal-body {
    padding: 1.5rem 2rem 2rem;
}

.external-calendar-modal .form-group {
    margin-bottom: 1.5rem;
}

.external-calendar-modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--modal-text);
    font-size: 0.9rem;
}

.external-calendar-modal .form-group input[type="text"],
.external-calendar-modal .form-group input[type="url"] {
    width: 100%;
    padding: var(--control-padding);
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-medium);
    font-size: 0.9rem;
    transition: var(--standard-transition);
    background: var(--input-background);
    color: var(--input-text);
}

.external-calendar-modal .form-group input[type="text"]:focus,
.external-calendar-modal .form-group input[type="url"]:focus {
    outline: none;
    border-color: var(--primary-color, #667eea);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.external-calendar-modal .form-group input[type="color"] {
    width: 80px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius-medium);
    cursor: pointer;
    background: none;
}

.external-calendar-modal .form-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

.external-calendar-modal .modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--modal-header-border);
    background: var(--modal-header-background);
    border-radius: 0 0 12px 12px;
}

.external-calendar-modal .btn {
    padding: var(--control-padding) 1.5rem;
    border-radius: var(--border-radius-medium);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--standard-transition);
    border: none;
    min-width: 100px;
}

.external-calendar-modal .btn-secondary {
    background: var(--button-secondary-bg);
    color: var(--button-secondary-text);
}

.external-calendar-modal .btn-secondary:hover:not(:disabled) {
    background: var(--button-secondary-bg);
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.external-calendar-modal .btn-primary {
    background: var(--primary-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    color: white;
}

.external-calendar-modal .btn-primary:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.external-calendar-modal .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.external-calendar-modal .error-message {
    background: var(--error-color);
    color: var(--text-inverse);
    padding: var(--control-padding) 1rem;
    border-radius: var(--border-radius-medium);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid #f5c6cb;
}

/* External Calendar Events (Visual Distinction) */
.event[data-external="true"] {
    position: relative;
    border-style: dashed !important;
    opacity: 0.85;
}

.event[data-external="true"]::before {
    content: "📅";
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.7rem;
    opacity: 0.7;
    z-index: 1;
}

/* Color Editor Modal */
.color-editor-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.color-editor-modal {
    background: var(--modal-background);
    color: var(--modal-text);
    border-radius: var(--border-radius-medium);
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 95%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalAppear 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--modal-header-border);
    background: var(--modal-header-background);
    border-radius: var(--border-radius-medium) var(--border-radius-medium) 0 0;
}

.color-editor-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-xs);
    line-height: 1;
    border-radius: var(--border-radius-small);
    transition: var(--transition-fast);
}

.close-button:hover {
    background: var(--background-tertiary);
    color: var(--text-primary);
}

.color-editor-content {
    padding: var(--spacing-md);
}

.current-color-preview {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--background-tertiary);
    border-radius: var(--border-radius-medium);
}

.color-preview-large {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-medium);
    border: 2px solid var(--border-secondary);
    flex-shrink: 0;
}

.color-preview-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    flex: 1;
}

.color-value {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.reset-this-color-button {
    background: var(--background-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--border-radius-small);
    padding: var(--spacing-xs) var(--spacing-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition-fast);
    align-self: flex-start;
}

.reset-this-color-button:hover {
    background: var(--background-tertiary);
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.color-input-section {
    margin-bottom: var(--spacing-lg);
}

.color-input-section label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.color-input-group {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.color-input-group input[type="color"] {
    width: 48px;
    height: 40px;
    border: 1px solid var(--border-secondary);
    border-radius: var(--border-radius-small);
    cursor: pointer;
    background: none;
    padding: 0;
}

.color-text-input {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-secondary);
    border-radius: var(--border-radius-small);
    font-family: monospace;
    font-size: 0.9rem;
    background: var(--background-secondary);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.color-text-input:focus {
    outline: none;
    border-color: var(--info-color);
    box-shadow: 0 0 0 2px rgba(23, 162, 184, 0.2);
}

.suggested-colors-section label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.suggested-colors-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: var(--spacing-sm);
}

.suggested-color {
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius-small);
    border: 2px solid var(--border-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.suggested-color:hover {
    transform: scale(1.1);
    border-color: var(--text-primary);
}

.color-editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-top: 1px solid var(--modal-header-border);
    background: var(--background-tertiary);
    border-radius: 0 0 var(--border-radius-medium) var(--border-radius-medium);
}

.cancel-button, .reset-all-button, .save-button {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-secondary);
    border-radius: var(--border-radius-small);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.cancel-button {
    background: var(--background-secondary);
    color: var(--text-secondary);
}

.cancel-button:hover {
    background: var(--background-tertiary);
    color: var(--text-primary);
}

.reset-all-button {
    background: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
    margin-left: auto;
    margin-right: var(--spacing-sm);
}

.reset-all-button:hover {
    background: #e0a800;
    border-color: #e0a800;
}

.save-button {
    background: var(--info-color);
    color: white;
    border-color: var(--info-color);
}

.save-button:hover {
    background: #138496;
    border-color: #138496;
}

/* Alarm List Component */
.alarm-list {
    margin-bottom: var(--spacing-lg);
}

.alarm-list h6 {
    margin: 0 0 var(--spacing-sm) 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.alarm-list-empty {
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--background-tertiary);
    border: 1px dashed var(--border-secondary);
    border-radius: var(--border-radius-medium);
    color: var(--text-secondary);
}

.alarm-list-empty p {
    margin: 0;
}

.alarm-list-empty .text-small {
    font-size: 0.8rem;
    margin-top: var(--spacing-xs);
}

.alarm-items {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.alarm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--background-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--border-radius-small);
    transition: var(--transition-fast);
}

.alarm-item:hover {
    background: var(--background-tertiary);
    border-color: var(--border-primary);
}

.alarm-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
}

.alarm-icon {
    font-size: 1.1rem;
    min-width: 24px;
    text-align: center;
}

.alarm-description {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.alarm-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.alarm-action-btn {
    background: none;
    border: none;
    padding: var(--spacing-xs);
    border-radius: var(--border-radius-small);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alarm-action-btn:hover {
    background: var(--background-tertiary);
    color: var(--text-primary);
}

.alarm-action-btn.edit-btn:hover {
    background: var(--info-color);
    color: white;
}

.alarm-action-btn.delete-btn:hover {
    background: var(--error-color);
    color: white;
}

.alarm-action-btn i {
    font-size: 0.8rem;
}

/* Alarm Management Header */
.alarm-management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.alarm-management-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.add-alarm-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-small);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.add-alarm-button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.25);
}

.add-alarm-button i {
    font-size: 0.8rem;
}

/* Alarm Types Info */
.alarm-types-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-sm);
    margin: var(--spacing-md) 0;
}

.alarm-type-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--background-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--border-radius-small);
    transition: var(--transition-fast);
}

.alarm-type-info:hover {
    background: var(--background-tertiary);
    border-color: var(--border-primary);
}

.alarm-type-info .alarm-icon {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
}

.alarm-type-info div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.alarm-type-info strong {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.alarm-type-info span:not(.alarm-icon) {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Event Reminder Icon */
.event-reminder-icon {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    margin-left: auto;
    flex-shrink: 0;
}

.event-box .event-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    width: 100%;
    min-width: 0;
}

.event-content .event-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-content .event-reminder-icon {
    margin-left: auto;
    flex-shrink: 0;
}

/* Event text sizing based on viewport width */
@media (max-width: 1200px) {
    .week-event .event-time {
        font-size: 0.55rem !important;
    }
    
    .week-event .event-title,
    .event-box .event-title,
    .event-content .event-title {
        font-size: 0.6rem !important;
    }
    
    .temp-event-box.moving-event .event-time,
    .temp-event-box.resizing-event .event-time {
        font-size: 0.55rem !important;
    }
    
    .temp-event-box.moving-event .event-title,
    .temp-event-box.resizing-event .event-title {
        font-size: 0.6rem !important;
    }
    
    .all-day-event {
        font-size: 0.6rem !important;
    }
    
    .event-box {
        font-size: 0.6rem !important;
    }
}

@media (max-width: 900px) {
    .week-event .event-time {
        font-size: 0.5rem !important;
    }
    
    .week-event .event-title,
    .event-box .event-title,
    .event-content .event-title {
        font-size: 0.55rem !important;
    }
    
    .temp-event-box.moving-event .event-time,
    .temp-event-box.resizing-event .event-time {
        font-size: 0.5rem !important;
    }
    
    .temp-event-box.moving-event .event-title,
    .temp-event-box.resizing-event .event-title {
        font-size: 0.55rem !important;
    }
    
    .all-day-event {
        font-size: 0.55rem !important;
    }
    
    .event-box {
        font-size: 0.55rem !important;
    }
}

@media (max-width: 600px) {
    .week-event .event-time {
        font-size: 0.45rem !important;
    }
    
    .week-event .event-title,
    .event-box .event-title,
    .event-content .event-title {
        font-size: 0.5rem !important;
    }
    
    .temp-event-box.moving-event .event-time,
    .temp-event-box.resizing-event .event-time {
        font-size: 0.45rem !important;
    }
    
    .temp-event-box.moving-event .event-title,
    .temp-event-box.resizing-event .event-title {
        font-size: 0.5rem !important;
    }
    
    .all-day-event {
        font-size: 0.5rem !important;
    }
    
    .event-box {
        font-size: 0.5rem !important;
    }
}

