:root {
    --primary-color: #6366F1;
    --primary-dark: #4F46E5;
    --secondary-color: #8B5CF6;
    --bg-color: #F9FAFB;
    --bg-gradient-start: #F9FAFB;
    --bg-gradient-end: #F3F4F6;
    --card-bg: #FFFFFF;
    --card-shadow: rgba(0, 0, 0, 0.08);
    --text-color: #1F2937;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --hover-color: rgba(99, 102, 241, 0.08);
    --success-color: #10B981;
    --error-color: #EF4444;
    --warning-color: #F59E0B;
    --input-bg: #FFFFFF;
    --input-border: #E5E7EB;
    --btn-bg: #FFFFFF;
    --btn-border: #E5E7EB;
    --btn-hover-bg: #F3F4F6;
    --modal-overlay: rgba(0, 0, 0, 0.5);
}

/* Dark Theme - ChatGPT/Gemini Style */
[data-theme="dark"] {
    --primary-color: #818CF8;
    --primary-dark: #6366F1;
    --secondary-color: #A78BFA;
    --bg-color: #212121;
    --bg-gradient-start: #171717;
    --bg-gradient-end: #212121;
    --card-bg: #2F2F2F;
    --card-shadow: rgba(0, 0, 0, 0.4);
    --text-color: #ECECEC;
    --text-secondary: #9CA3AF;
    --border-color: #424242;
    --hover-color: rgba(129, 140, 248, 0.2);
    --input-bg: #303030;
    --input-border: #424242;
    --btn-bg: #3F3F3F;
    --btn-border: #525252;
    --btn-hover-bg: #4A4A4A;
    --modal-overlay: rgba(0, 0, 0, 0.8);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

header {
    margin-bottom: 2.5rem;
}

/* Header Layout */
.user-greeting {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--btn-bg);
    color: var(--text-color);
    border: 1px solid var(--btn-border);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.header-btn:hover {
    background: var(--btn-hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.header-btn-danger:hover {
    border-color: var(--error-color);
    color: var(--error-color);
}

/* Mobile: Hide button labels, show only icons */
@media (max-width: 600px) {
    .header-actions {
        gap: 0.375rem;
    }

    .header-btn {
        padding: 0.5rem;
    }

    .header-btn .btn-label {
        display: none;
    }

    .language-selector {
        padding: 0.125rem;
    }

    .lang-btn {
        padding: 0.3rem 0.4rem;
        font-size: 1rem;
    }
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

/* Search Bar */
.search-section {
    margin-bottom: 1.5rem;
}

.search-container {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 12px;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--card-shadow);
}

.search-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    opacity: 0.6;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text-color);
    outline: none;
    padding: 0.5rem 0;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-clear {
    background: var(--border-color);
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.search-clear:hover {
    background: var(--error-color);
    color: white;
}

.search-highlight {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
    padding: 0 2px;
    border-radius: 2px;
}

/* Dashboard Section */
.dashboard-section {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--card-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.dashboard-section .section-header {
    background: linear-gradient(135deg, var(--primary-color)10 0%, var(--secondary-color)10 100%);
}

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

.stat-card {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--card-shadow);
}

.stat-icon {
    font-size: 1.75rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-chart {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.chart-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.chart-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chart-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chart-bar-label {
    width: 80px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.chart-bar-track {
    flex: 1;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.chart-bar-value {
    width: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: right;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }
}

.note-input-section {
    background: var(--card-bg);
    padding: 0;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease;
}

.note-input-section:hover {
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.12);
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid var(--input-border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 0;
    transition: all 0.3s ease;
    background: var(--input-bg);
    color: var(--text-color);
}

textarea::placeholder {
    color: var(--text-secondary);
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* Language Selector */
.language-selector {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-color);
    border-radius: 8px;
    padding: 0.25rem;
    border: 1px solid var(--border-color);
}

.lang-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.lang-btn:hover {
    opacity: 1;
    background: var(--hover-color);
    transform: scale(1.1);
}

.lang-btn.active {
    opacity: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Theme Icon Animation */
.theme-icon {
    transition: transform 0.3s ease;
    font-size: 1.1rem;
}

[data-theme="dark"] .theme-icon {
    transform: rotate(180deg);
}

/* Desktop: Grid layout with separated buttons */
.input-actions {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.75rem;
    margin-top: 1.25rem;
    align-items: center;
}

.input-actions #mic-btn {
    justify-self: end;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #A78BFA 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.btn-sm {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

.btn-icon {
    background-color: var(--btn-bg);
    color: var(--text-secondary);
    border: 2px solid var(--btn-border);
    min-width: 140px;
    box-shadow: 0 2px 8px var(--card-shadow);
}

.btn-icon:hover:not(:disabled) {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: var(--btn-hover-bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-icon.recording {
    background: linear-gradient(135deg, var(--error-color) 0%, #DC2626 100%);
    color: white;
    border-color: var(--error-color);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
    }

    50% {
        opacity: 0.85;
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
    }
}

.assistant-section {
    background: var(--card-bg);
    padding: 0;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

/* Section headers (for collapsible sections) */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    border-bottom: 1px solid transparent;
    border-radius: 16px 16px 0 0;
}

.section-header:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-bottom-color: rgba(99, 102, 241, 0.2);
}

.section-title {
    font-weight: 600;
    font-size: 1.0625rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    font-size: 1.25rem;
}

.assistant-section .section-title::before {
    content: '🤖';
}

.note-input-section .section-title::before {
    content: '📝';
}

.section-toggle-icon {
    font-size: 0.875rem;
    color: var(--primary-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
}

.assistant-section.collapsed .section-toggle-icon,
.note-input-section.collapsed .section-toggle-icon,
.dashboard-section.collapsed .section-toggle-icon,
.trash-section.collapsed .section-toggle-icon {
    transform: rotate(-90deg);
}

.section-content {
    padding: 1.5rem;
    max-height: 1000px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.assistant-section.collapsed .section-content,
.note-input-section.collapsed .section-content,
.dashboard-section.collapsed .section-content,
.trash-section.collapsed .section-content,
.calendar-section.collapsed .section-content {
    max-height: 0;
    padding: 0 1.5rem;
    opacity: 0;
    display: none;
}

.assistant-section h2 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    color: var(--text-color);
}

.quick-questions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.input-group {
    display: flex;
    gap: 0.75rem;
}

.input-group input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--input-border);
    border-radius: 10px;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    background: var(--input-bg);
    color: var(--text-color);
}

.input-group input::placeholder {
    color: var(--text-secondary);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.notes-list {
    display: grid;
    gap: 1.25rem;
}

/* Trash Section */
.trash-section {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--card-shadow);
    margin-top: 2rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.trash-section .section-header {
    background: linear-gradient(135deg, var(--error-color)15 0%, var(--warning-color)15 100%);
    border-bottom: 1px solid var(--border-color);
}

.trash-count {
    background: var(--error-color);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.trash-count:empty {
    display: none;
}

.trash-list {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
}

.trash-card {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    opacity: 0.8;
}

.trash-card-text {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trash-card-actions {
    display: flex;
    gap: 0.5rem;
}

.trash-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.trash-btn.restore {
    background: var(--success-color);
    color: white;
}

.trash-btn.restore:hover {
    background: #059669;
    transform: scale(1.05);
}

.trash-btn.delete {
    background: var(--error-color);
    color: white;
}

.trash-btn.delete:hover {
    background: #DC2626;
    transform: scale(1.05);
}

.note-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--card-shadow);
    transition: all 0.3s ease;
}

.note-card:hover {
    box-shadow: 0 4px 16px var(--card-shadow);
    transform: translateY(-2px);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.note-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.note-type {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    background: #F3F4F6;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Notes Filters Section */
.notes-filters {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    border-bottom: 1px solid transparent;
}

.filter-header:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-bottom-color: rgba(99, 102, 241, 0.2);
}

.filter-title {
    font-weight: 600;
    font-size: 1.0625rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-title::before {
    content: '🔍';
    font-size: 1.25rem;
}

.filter-toggle-icon {
    font-size: 0.875rem;
    color: var(--primary-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
}

.notes-filters.collapsed .filter-toggle-icon {
    transform: rotate(-90deg);
}

.filter-content {
    padding: 0 2rem 2rem 2rem;
    max-height: 500px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.notes-filters.collapsed .filter-content {
    max-height: 0;
    padding: 0 2rem;
    opacity: 0;
}

.notes-filters:not(.collapsed) .filter-content {
    opacity: 1;
}

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

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.filter-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.75rem;
}

.filter-btn {
    padding: 0.75rem 1.25rem;
    border: 2px solid var(--btn-border);
    border-radius: 12px;
    background: var(--btn-bg);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 1px 3px var(--card-shadow);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--hover-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

.filter-btn.active:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.custom-date-range {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.custom-date-range input[type="date"] {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9375rem;
    background: white;
    color: var(--text-color);
    font-family: inherit;
    transition: all 0.2s ease;
}

.custom-date-range input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.custom-date-range span {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.125rem;
}

.note-text {
    white-space: pre-wrap;
    line-height: 1.6;
    color: var(--text-color);
}

.ai-analysis {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.ai-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

.ai-suggestion {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
    font-style: italic;
}

.priority {
    font-size: 0.875rem;
    color: #F59E0B;
    margin-left: 0.5rem;
}

/* Responsive design for mobile */
@media (max-width: 640px) {
    .container {
        padding: 1rem 0.875rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    header>div {
        flex-direction: column !important;
        gap: 1rem;
    }

    header>div>div:last-child {
        text-align: center !important;
    }

    .quick-questions {
        justify-content: center;
    }

    .note-input-section {
        padding: 1.25rem;
    }

    .assistant-section {
        padding: 1.25rem;
    }

    /* Mobile filters - enhanced header */
    .filter-header {
        padding: 1.5rem 1.25rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .filter-title {
        font-size: 1.125rem;
    }

    .filter-title::before {
        font-size: 1.5rem;
    }

    .filter-toggle-icon {
        font-size: 1rem;
    }

    .notes-filters {
        padding: 1.25rem;
    }

    .filter-group {
        margin-bottom: 1.25rem;
    }

    .filter-label {
        font-size: 0.9375rem;
        margin-bottom: 0.75rem;
    }

    .filter-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.625rem;
    }

    .filter-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        min-height: 48px;
    }

    .custom-date-range {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .custom-date-range span {
        display: none;
    }

    .custom-date-range input[type="date"] {
        width: 100%;
    }

    textarea {
        font-size: 16px;
        /* Previene zoom en iOS */
        min-height: 120px;
    }

    /* Mobile: Botones en fila con micrófono a la derecha */
    .input-actions {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    #save-btn {
        order: 1;
        flex: 1;
        min-width: 0;
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }

    #improve-input-btn {
        order: 2;
        flex: 1;
        min-width: 0;
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }

    #mic-btn {
        order: 3;
        flex: 0 0 auto;
        min-width: 56px;
        min-height: 56px;
        padding: 0;
        font-size: 1.5rem;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        color: white;
        border: none;
        border-radius: 14px;
        box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    }

    #mic-btn:hover:not(:disabled) {
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-color) 100%);
    }

    #mic-btn.recording,
    #assistant-mic-btn.recording {
        background: linear-gradient(135deg, var(--error-color) 0%, #DC2626 100%);
        box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
        animation: pulse-red 1.5s infinite ease-in-out;
    }

    #mic-btn.transcribing,
    #assistant-mic-btn.transcribing {
        background: linear-gradient(90deg, #6366f1 0%, #a855f7 50%, #6366f1 100%);
        background-size: 200% 100%;
        animation: shimmer 1.5s infinite linear;
        cursor: wait;
    }

    #mic-btn.success-flash,
    #assistant-mic-btn.success-flash {
        animation: success-glow 0.8s ease-out;
    }

    @keyframes pulse-red {
        0% {
            transform: scale(1);
            box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
        }

        50% {
            transform: scale(1.05);
            box-shadow: 0 4px 25px rgba(239, 68, 68, 0.6);
        }

        100% {
            transform: scale(1);
            box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
        }
    }

    @keyframes shimmer {
        0% {
            background-position: 200% 0;
        }

        100% {
            background-position: -200% 0;
        }
    }

    @keyframes success-glow {
        0% {
            background: #10B981;
            transform: scale(1.1);
            box-shadow: 0 0 20px #10B981;
        }

        100% {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
            transform: scale(1);
            box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
        }
    }

    #mic-btn span:not(:first-child) {
        display: none;
    }

    /* Assistant section buttons - same behavior as note section */
    #ask-btn {
        order: 1;
        flex: 1;
        min-width: 0;
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }

    #assistant-mic-btn {
        order: 2;
        flex: 0 0 auto;
        min-width: 56px;
        min-height: 56px;
        padding: 0;
        font-size: 1.5rem;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        color: white;
        border: none;
        border-radius: 14px;
        box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    }

    #assistant-mic-btn:hover:not(:disabled) {
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-color) 100%);
    }

    #assistant-mic-btn.recording {
        background: linear-gradient(135deg, var(--error-color) 0%, #DC2626 100%);
        box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
    }

    #assistant-mic-btn span:not(:first-child) {
        display: none;
    }

    .note-card {
        padding: 1.25rem;
    }

    .btn-sm {
        font-size: 0.8125rem;
        padding: 0.5rem 1rem;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group input {
        font-size: 16px;
    }

    .input-group button {
        width: 100%;
        padding: 0.875rem;
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    .note-input-section {
        padding: 1rem;
    }

    .assistant-section {
        padding: 1rem;
    }

    #save-btn {
        font-size: 0.875rem;
        padding: 0.75rem 0.875rem;
    }

    #mic-btn {
        min-width: 52px;
        min-height: 52px;
        font-size: 1.375rem;
    }

    .input-actions {
        gap: 0.625rem;
    }

    h1 {
        font-size: 1.5rem;
    }
}

/* ============================================
   NOTES TOOLBAR & BULK ACTIONS
   ============================================ */

.notes-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 1rem;
}

.toolbar-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.toolbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-tool {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--btn-bg);
    color: var(--text-secondary);
    border: 1px solid var(--btn-border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-tool:hover:not(:disabled) {
    background: var(--btn-hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-tool:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-tool.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--error-color);
    color: var(--error-color);
}

/* Note card with checkbox */
.note-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.note-checkbox {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 0.25rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.note-content-wrapper {
    flex: 1;
    min-width: 0;
}

.note-card.selected {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-color: var(--primary-color);
}

.note-card.editing .note-text {
    display: none;
}

.note-edit-textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    margin-top: 0.5rem;
}

.note-edit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: flex-end;
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    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;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px var(--card-shadow);
    border: 1px solid var(--border-color);
}

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

.modal-header p {
    margin: 0.5rem 0 0 0;
    font-size: 0.9375rem;
}

/* Logo Brain */
.logo-brain {
    font-size: 3rem;
    display: inline-block;
    background: linear-gradient(135deg, #FF6B9D 0%, #C239B3 100%);
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(255, 107, 157, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

.preview-section {
    margin-bottom: 1.5rem;
}

.preview-section:last-child {
    margin-bottom: 0;
}

.preview-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-text {
    background: var(--input-bg);
    color: var(--text-color);
    padding: 1rem;
    border-radius: 8px;
    white-space: pre-wrap;
    font-size: 0.9375rem;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

#modal-improved .preview-text {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-color: var(--success-color);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.modal-loading .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESPONSIVE - TOOLBAR & MODAL
   ============================================ */

@media (max-width: 640px) {
    .notes-toolbar {
        padding: 0.75rem 1rem;
    }

    .toolbar-actions {
        width: 100%;
        justify-content: center;
        gap: 0.75rem;
    }

    .btn-tool {
        padding: 0.75rem;
        min-width: 52px;
        min-height: 52px;
        justify-content: center;
        font-size: 1.25rem;
    }

    .btn-tool .btn-text {
        display: none;
    }

    .note-card {
        gap: 0.75rem;
    }

    .note-checkbox {
        width: 24px;
        height: 24px;
    }

    .modal-content {
        max-height: 85vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* Custom Confirmation Modal */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 15000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.confirm-modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    animation: slideUp 0.25s ease-out;
}

/* Light Mode Overrides */
body.light-mode .confirm-modal-content,
[data-theme="light"] .confirm-modal-content {
    background: #FFFFFF !important;
    border: 1px solid var(--light-border) !important;
    color: #000000 !important;
    box-shadow: var(--light-shadow) !important;
}

body.light-mode .confirm-modal,
[data-theme="light"] .confirm-modal {
    background: rgba(255, 255, 255, 0.8) !important;
}

.confirm-modal-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.confirm-modal-message {
    font-size: 1.1rem;
    color: var(--text-color);
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

.confirm-modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.confirm-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 110px;
}

.confirm-btn-cancel {
    background: var(--btn-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.confirm-btn-cancel:hover {
    background: var(--border-color);
}

.confirm-btn-accept {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.confirm-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.confirm-btn-accept.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.confirm-btn-accept.danger:hover {
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* Mobile responsive */
@media (max-width: 480px) {
    .confirm-modal-content {
        padding: 1.5rem;
        margin: 1rem;
        max-width: 100%;
    }

    .confirm-modal-icon {
        font-size: 2.5rem;
    }

    .confirm-modal-message {
        font-size: 1rem;
    }

    .confirm-modal-buttons {
        flex-direction: column;
    }

    .confirm-btn {
        width: 100%;
        padding: 0.9rem 1.5rem;
    }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 0.7s forwards;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Light Mode Overrides */
body.light-mode .toast,
[data-theme="light"] .toast {
    background: #FFFFFF !important;
    color: #000000 !important;
    border: 1px solid var(--light-border) !important;
    box-shadow: var(--light-shadow) !important;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        transform: translateY(-20px);
        opacity: 0;
    }
}

/* Assistant Response Container */
.assistant-response {
    display: none;
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.response-header strong {
    color: var(--primary-color);
}

.response-actions {
    display: flex;
    gap: 0.5rem;
}

#response-text {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.6;
}

/* Button variants */
.btn-success {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Mobile Quick Questions Grid */
@media (max-width: 640px) {
    .quick-questions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .quick-questions .btn {
        width: 100%;
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
        text-align: center;
        justify-content: center;
    }

    /* Wider textareas on mobile */
    textarea {
        width: 100% !important;
    }

    .section-content {
        padding: 1rem;
    }

    .section-content textarea {
        font-size: 16px;
        /* Prevents zoom on iOS */
        min-height: 180px;
    }

    /* Input actions mobile */
    .input-actions {
        display: flex;
        gap: 0.5rem;
    }

    .input-actions .btn-primary {
        flex: 1;
    }

    .input-actions .btn-icon {
        min-width: 48px;
        padding: 0.75rem;
    }

    /* Response actions mobile */
    .response-actions .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    /* Toast mobile */
    #toast-container {
        left: 1rem;
        right: 1rem;
        top: auto;
        bottom: 1rem;
    }

    .toast {
        text-align: center;
        justify-content: center;
    }
}

/* ========================================
   CALENDAR SECTION
   ======================================== */
.calendar-section {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--card-shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.calendar-section .section-header {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%);
    border-bottom: 1px solid transparent;
}

.calendar-section .section-header:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(59, 130, 246, 0.12) 100%);
}

.calendar-section.collapsed .section-toggle-icon {
    transform: rotate(-90deg);
}

/* Calendar collapsed state - hide content completely */
.calendar-section.collapsed .section-content {
    display: none;
}

.calendar-section .section-content {
    padding: 1.5rem;
    max-height: 2000px;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

/* Calendar Controls - Year & Navigation */
.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.calendar-year-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-color);
    border-radius: 10px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
}

.calendar-year-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-year-btn:hover {
    background: var(--hover-color);
    color: var(--primary-color);
}

.calendar-year-display {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    min-width: 60px;
    text-align: center;
}

.calendar-today-btn {
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-today-btn:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Calendar Container */
#calendar-container {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    min-height: 400px;
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
    padding: 1rem 0.5rem;
    background: var(--bg-color);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
    user-select: none;
}

.legend-item:hover {
    color: var(--text-color);
}

.legend-item.inactive {
    opacity: 0.4;
    filter: grayscale(100%);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* FullCalendar Theme Customization */
.fc {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.fc .fc-button {
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: none;
}

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

.fc .fc-button:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
    color: white;
}

.fc .fc-toolbar {
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.fc .fc-toolbar-title {
    color: var(--text-color);
    font-size: 1.25rem;
    font-weight: 600;
    text-transform: capitalize;
}

/* Calendar Header */
.fc .fc-col-header {
    background: var(--bg-color);
}

.fc .fc-col-header-cell {
    background: transparent;
    border-color: var(--border-color);
    padding: 0.75rem 0.5rem;
}

.fc .fc-col-header-cell-cushion {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
}

/* Day Grid (Month View) */
.fc .fc-daygrid-day {
    background: var(--card-bg);
    border-color: var(--border-color);
    transition: background 0.2s ease;
}

.fc .fc-daygrid-day:hover {
    background: var(--hover-color);
}

.fc .fc-daygrid-day-frame {
    min-height: 80px;
}

.fc .fc-daygrid-day-number {
    color: var(--text-color);
    padding: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
}

.fc .fc-daygrid-day.fc-day-today {
    background: rgba(99, 102, 241, 0.08) !important;
}

.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.fc .fc-day-other .fc-daygrid-day-number {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Events */
.fc .fc-event {
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    margin: 1px 2px;
}

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

.fc .fc-event-title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Time Grid (Week/Day View) */
.fc .fc-timegrid {
    background: var(--card-bg);
}

.fc .fc-timegrid-slot {
    height: 2.5rem;
    border-color: var(--border-color);
}

.fc .fc-timegrid-slot-label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
}

.fc .fc-timegrid-col {
    background: var(--card-bg);
    border-color: var(--border-color);
}

.fc .fc-timegrid-col.fc-day-today {
    background: rgba(99, 102, 241, 0.05) !important;
}

/* Now Indicator */
.fc .fc-timegrid-now-indicator-line {
    border-color: var(--error-color);
    border-width: 2px;
}

.fc .fc-timegrid-now-indicator-arrow {
    border-color: var(--error-color);
    border-top-color: transparent;
    border-bottom-color: transparent;
}

/* Scrollbar */
.fc .fc-scroller {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.fc .fc-scroller::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.fc .fc-scroller::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* Dark mode adjustments for FullCalendar */
[data-theme="dark"] .fc .fc-scrollgrid {
    border-color: var(--border-color);
}

[data-theme="dark"] .fc .fc-scrollgrid td,
[data-theme="dark"] .fc .fc-scrollgrid th {
    border-color: var(--border-color);
}

[data-theme="dark"] .fc td,
[data-theme="dark"] .fc th {
    border-color: var(--border-color);
}

[data-theme="dark"] .fc .fc-daygrid-day-frame {
    background: transparent;
}

[data-theme="dark"] .fc .fc-timegrid-slot {
    border-color: var(--border-color);
}

[data-theme="dark"] .fc .fc-event {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Mobile responsiveness */
@media (max-width: 768px) {

    .calendar-section .section-content {
        padding: 1rem;
    }

    .calendar-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .calendar-year-nav {
        justify-content: center;
    }

    .calendar-today-btn {
        width: 100%;
    }

    #calendar-container {
        padding: 0.5rem;
        min-height: 300px;
    }

    .fc .fc-toolbar {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

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

    .fc .fc-toolbar-title {
        font-size: 1rem;
        width: 100%;
        text-align: center;
        order: -1;
    }

    .fc .fc-button {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    .fc .fc-daygrid-day-frame {
        min-height: 60px;
    }

    .fc .fc-daygrid-day-number {
        font-size: 0.75rem;
        padding: 0.25rem;
    }

    .fc .fc-event {
        font-size: 0.65rem;
        padding: 1px 3px;
    }

    .calendar-legend {
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .legend-item {
        font-size: 0.7rem;
    }

    .legend-color {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .calendar-year-nav {
        padding: 0.2rem 0.4rem;
    }

    .calendar-year-btn {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
    }

    .calendar-year-display {
        font-size: 0.875rem;
        min-width: 50px;
    }

    .fc .fc-col-header-cell-cushion {
        font-size: 0.65rem;
    }

    .fc .fc-timegrid-slot-label {
        font-size: 0.6rem;
    }
}