/* ==================== ROOT VARIABLES ==================== */
:root {
    /* Dark Light Blue Color Palette */
    --primary-50: #e3f2fd;
    --primary-100: #bbdefb;
    --primary-200: #90caf9;
    --primary-300: #64b5f6;
    --primary-400: #42a5f5;
    --primary-500: #1976D2; /* Main Dark Light Blue */
    --primary-600: #1565c0;
    --primary-700: #0d47a1;
    --primary-800: #0a3d8f;
    --primary-900: #062a6e;
    
    /* Gradient */
    --gradient-primary: linear-gradient(135deg, #0d47a1 0%, #1976D2 50%, #42a5f5 100%);
    --gradient-secondary: linear-gradient(135deg, #1565c0 0%, #1976D2 100%);
    --gradient-dark: linear-gradient(135deg, #062a6e 0%, #0a3d8f 100%);
    --gradient-light: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    --gradient-sidebar: linear-gradient(180deg, #1B5B7C 0%, #0D3850 100%);
    
    /* Neutral Colors */
    --white: #f0f0f0;
    --card-bg: #ffffff;
    --gray-50: #f5f5f5;
    --gray-100: #ebebeb;
    --gray-200: #d9d9d9;
    --gray-300: #c4c4c4;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --gray-900: #171923;
    
    /* Accent Colors */
    --success: #48BB78;
    --warning: #ECC94B;
    --danger: #F56565;
    --info: #4299E1;
    
    /* File Type Colors */
    --color-pdf: #E53E3E;
    --color-word: #3182CE;
    --color-image: #38A169;
    --color-video: #805AD5;
    --color-audio: #D69E2E;
    --color-other: #718096;
    
    /* Spacing */
    --sidebar-width: 280px;
    --sidebar-collapsed: 70px;
    --header-height: 70px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --shadow-mustard: 0 4px 14px rgba(139, 117, 0, 0.4);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #1A78C2 0%, #1791AE 50%, #0096AA 100%);
    min-height: 100vh;
    color: var(--gray-700);
    display: flex;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--gradient-sidebar);
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
    z-index: 1000;
    box-shadow: var(--shadow-xl);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    font-weight: 700;
    font-size: 1.1rem;
}

.logo i {
    font-size: 1.8rem;
    background: var(--gradient-light);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar.collapsed .logo span {
    display: none;
}

.sidebar-toggle {
    color: var(--white);
    font-size: 1.2rem;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-search {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-mode-selector {
    width: 100%;
}

.search-mode-selector select {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.95);
    color: var(--gray-700);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.search-mode-selector select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-input-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: none;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.95);
    color: var(--gray-700);
    font-size: 0.9rem;
    transition: box-shadow var(--transition-fast);
}

.search-input-wrapper input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.sidebar.collapsed .sidebar-search {
    display: none;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.nav-menu {
    padding: 0 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: rgba(255, 255, 255, 0.8);
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    font-weight: 500;
}

.nav-item i:first-child {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.submenu-arrow {
    margin-left: auto;
    font-size: 0.8rem;
    transition: transform var(--transition-fast);
}

.nav-item.has-submenu.expanded .submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
    padding-left: 20px;
}

.submenu.expanded {
    max-height: 500px;
}

.submenu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.submenu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.submenu-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.submenu-item i {
    font-size: 0.9rem;
    width: 20px;
    text-align: center;
}

.sidebar.collapsed .nav-item span,
.sidebar.collapsed .submenu-arrow,
.sidebar.collapsed .submenu {
    display: none;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-add-note {
    width: 100%;
    padding: 14px;
    background: var(--white);
    color: var(--primary-600);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.btn-add-note:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.sidebar.collapsed .btn-add-note span {
    display: none;
}


.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
    z-index: 999;
}

.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-normal);
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

.main-header {
    height: var(--header-height);
    background: linear-gradient(135deg, #0a1a2f 0%, #15203a 50%, #0a1628 100%);
    backdrop-filter: blur(10px);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(4, 24, 48, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.header-title-group {
    display: flex;
    flex-direction: column;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--white);
}

.header-datetime {
    font-size: 0.8rem;
    color: var(--gray-400);
    font-weight: 400;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.3rem;
    color: var(--gray-300);
    padding: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-upload {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(180deg, #1B5B7C 0%, #0D3850 100%);
    color: var(--white);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 56, 80, 0.5);
}

.view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 4px;
}

.view-btn {
    padding: 8px 12px;
    color: var(--gray-400);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.view-btn.active {
    background: var(--primary-500);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(220, 38, 38, 0.9);
    color: var(--white);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
    font-size: 14px;
}

.btn-logout:hover {
    background: rgba(185, 28, 28, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.btn-logout i {
    font-size: 16px;
}

/* ==================== USER MENU DROPDOWN ==================== */
.user-menu-dropdown {
    position: relative;
}

.btn-user-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 18px;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.btn-user-menu:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.user-menu-content {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 1000;
}

.user-menu-dropdown.active .user-menu-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 14px;
}

.user-menu-item:hover {
    background: #f5f5f5;
    color: #1A78C2;
}

.user-menu-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.user-menu-item.logout:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.user-menu-divider {
    height: 1px;
    background: #eee;
    margin: 4px 0;
}

/* ==================== CONTENT SECTIONS ==================== */
.content-section {
    padding: 30px;
    animation: fadeIn 0.3s ease;
}

.content-section.hidden {
    display: none;
}

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

/* ==================== STATS GRID ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #1B5B7C 0%, #0D3850 100%);
    border-radius: var(--radius-lg);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: 1.5rem;
    color: var(--primary-600);
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
}

.stat-info p {
    color: #ffffff;
    font-size: 0.9rem;
}

/* ==================== DASHBOARD GRID ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.dashboard-section {
    background: linear-gradient(135deg, #1B5B7C 0%, #0D3850 100%);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dashboard-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-section h2 i {
    color: var(--primary-500);
}

.file-types-chart {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-type-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-type-bar i {
    width: 30px;
    text-align: center;
    font-size: 1.1rem;
}

.file-type-bar .bar-container {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.file-type-bar .bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.file-type-bar .count {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
    min-width: 30px;
    text-align: right;
}

/* ==================== NOTES GRID ==================== */
.notes-container {
    min-height: 400px;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.notes-grid.list-view {
    grid-template-columns: 1fr;
}

.note-card {
    background: #E8F5F7;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-fast);
    position: relative;
}

.note-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.note-card-clickable {
    cursor: pointer;
}

.note-card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 10;
}

.note-card:hover .note-card-actions {
    opacity: 1;
}

.card-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.card-btn-edit {
    background: var(--primary-500);
    color: var(--white);
}

.card-btn-edit:hover {
    background: var(--primary-600);
    transform: scale(1.1);
}

.card-btn-delete {
    background: var(--danger);
    color: var(--white);
}

.card-btn-delete:hover {
    background: #E53E3E;
    transform: scale(1.1);
}

.note-favorite {
    position: absolute;
    top: 15px;
    left: 15px;
    color: var(--warning);
    font-size: 1rem;
    z-index: 5;
}

.note-card-header {
    padding: 20px 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.note-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.note-icon i {
    font-size: 1.3rem;
    color: var(--primary-600);
}

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

.note-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-info p {
    font-size: 0.85rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Simple Card Layout */
.note-card-simple {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
}

.note-icon-large {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.note-icon-large i {
    font-size: 1.4rem;
    color: white;
}

.note-info-simple {
    flex: 1;
    min-width: 0;
}

.note-info-simple h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0D1016;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-subtitle-card {
    font-size: 0.85rem;
    color: #252B34;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Search result highlights */
.search-highlight {
    background: #ffe066;
    color: #333;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

.search-match-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #1A78C2;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.search-match-info i {
    font-size: 0.7rem;
}

.match-location-badge {
    background: #e3f2fd;
    color: #1565c0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.search-content-snippet {
    font-size: 0.78rem;
    color: #555;
    margin-bottom: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    border-left: 3px solid #1A78C2;
    line-height: 1.5;
    max-height: 60px;
    overflow: hidden;
}

.search-content-snippet i {
    color: #1A78C2;
    margin-right: 4px;
    font-size: 0.7rem;
}

.note-meta-simple {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.note-category-badge {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 500;
}

.note-attachment-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    color: var(--gray-600);
}

.note-card-tags {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.note-card-tag {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
}

.note-card-body {
    padding: 15px 20px;
}

.note-excerpt {
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.note-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.note-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.note-category {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

/* List View */
.notes-grid.list-view .note-card {
    display: flex;
    align-items: center;
}

.notes-grid.list-view .note-card-header {
    padding: 15px;
    flex-shrink: 0;
}

.notes-grid.list-view .note-card-body {
    flex: 1;
    padding: 15px;
    border-left: 1px solid var(--gray-100);
}

.notes-grid.list-view .note-card-footer {
    border-top: none;
    border-left: 1px solid var(--gray-100);
    padding: 15px 20px;
}

/* ==================== ALPHABET SORT SELECTOR ==================== */
.alphabet-sort-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.alphabet-sort-selector label {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.95rem;
}

.alphabet-sort-selector select {
    padding: 10px 35px 10px 15px;
    font-size: 0.95rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--gray-800);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.alphabet-sort-selector select:hover {
    border-color: var(--primary-400);
}

.alphabet-sort-selector select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
}

/* ==================== ALPHABET NAV ==================== */
.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.alphabet-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-100);
    transition: all var(--transition-fast);
}

.alphabet-btn:hover {
    background: var(--primary-100);
    color: var(--primary-600);
}

.alphabet-btn.active {
    background: var(--gradient-primary);
    color: var(--white);
}

.alphabet-btn.has-notes {
    background: var(--primary-50);
    color: var(--primary-600);
}

.alphabet-btn .count {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.65rem;
    background: var(--primary-500);
    color: var(--white);
    padding: 2px 5px;
    border-radius: var(--radius-full);
}

/* ==================== FILES GRID ==================== */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.file-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-fast);
    position: relative;
}

/* Soft color variations for cards */
.file-card:nth-child(5n+1) {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%); /* Soft Green */
}
.file-card:nth-child(5n+2) {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%); /* Soft Cyan */
}
.file-card:nth-child(5n+3) {
    background: linear-gradient(135deg, #e2d9f3 0%, #d4c4ec 100%); /* Soft Purple */
}
.file-card:nth-child(5n+4) {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%); /* Soft Yellow */
}
.file-card:nth-child(5n+5) {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%); /* Soft Magenta/Pink */
}

.file-card-content {
    cursor: pointer;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* File Delete Button */
.file-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(229, 62, 62, 0.9);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-fast);
    z-index: 10;
}

.file-delete-btn:hover {
    background: #C53030;
    transform: scale(1.1);
}

.file-card:hover .file-delete-btn {
    opacity: 1;
}

.file-card-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-card-icon i {
    font-size: 2rem;
    color: var(--white);
}

.file-card-icon.pdf { background: linear-gradient(135deg, #E53E3E, #C53030); }
.file-card-icon.word { background: linear-gradient(135deg, #3182CE, #2B6CB0); }
.file-card-icon.image { background: linear-gradient(135deg, #38A169, #2F855A); }
.file-card-icon.video { background: linear-gradient(135deg, #805AD5, #6B46C1); }
.file-card-icon.audio { background: linear-gradient(135deg, #D69E2E, #B7791F); }
.file-card-icon.other { background: linear-gradient(135deg, #718096, #4A5568); }

.file-card h4 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card p {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* File Thumbnail */
.file-card-thumbnail {
    width: 100%;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 15px;
}

.file-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==================== NOTE DETAIL ==================== */
.note-detail {
    max-width: 900px;
    margin: 0 auto;
}

.note-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    color: var(--gray-300);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    background: rgba(255, 255, 255, 0.1);
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.note-actions {
    display: flex;
    gap: 10px;
}

.btn-action {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    color: var(--gray-600);
    background: var(--gray-100);
    transition: all var(--transition-fast);
    font-weight: 500;
    font-size: 0.9rem;
}

.btn-action:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.btn-action.btn-edit {
    background: var(--primary-50);
    color: var(--primary-600);
}

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

.btn-action.btn-fav {
    width: 40px;
    padding: 0;
}

.btn-action.btn-fav.active {
    color: var(--warning);
    background: #FFF8E1;
}

.btn-action.btn-delete {
    background: #FEE2E2;
    color: var(--danger);
}

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

.btn-action.active {
    color: var(--warning);
}

.note-detail-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
}

.note-detail-content .note-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 10px;
}

.note-detail-content .note-subtitle {
    font-size: 1.2rem;
    color: var(--gray-500);
    margin-bottom: 20px;
}

.note-detail-content .note-meta-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
    color: var(--gray-600);
}

.note-detail-content .note-meta-detail span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.note-detail-content .note-meta-detail i {
    color: var(--primary-500);
}

.note-detail-content .note-body {
    line-height: 1.6;
    color: var(--gray-700);
}

.note-detail-content .note-body br + br {
    display: none;
}

.note-detail-content .note-body ul,
.note-detail-content .note-body ol {
    margin: 8px 0;
    padding-left: 25px;
}

.note-detail-content .note-body li {
    margin: 4px 0;
}

.note-detail-content .note-body p {
    margin: 8px 0;
}

.note-detail-content .note-body img {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: 20px 0;
}

.note-detail-content .note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.tag {
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
}

/* ==================== ATTACHMENTS ==================== */
.note-attachments {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.note-attachments h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.note-attachments h3 i {
    color: var(--primary-500);
}

.attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.attachment-item {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.attachment-item:hover {
    background: var(--gray-100);
    transform: translateY(-2px);
}

.attachment-item .file-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 10px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-item .file-icon i {
    font-size: 1.5rem;
    color: var(--white);
}

.attachment-item .file-name {
    font-size: 0.8rem;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-item .delete-attachment {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: var(--danger);
    color: var(--white);
    border-radius: var(--radius-full);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.attachment-item:hover .delete-attachment {
    display: flex;
}

.btn-add-attachment {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: var(--radius-md);
    font-weight: 500;
    border: 2px dashed var(--gray-300);
    transition: all var(--transition-fast);
}

.btn-add-attachment:hover {
    background: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-600);
}

/* ==================== MODALS ==================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    backdrop-filter: blur(8px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-content.modal-small {
    max-width: 450px;
}

.modal-content.modal-large {
    max-width: 800px;
}

.modal-content.modal-fullscreen {
    max-width: 95vw;
    max-height: 95vh;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--gray-500);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==================== FORM ELEMENTS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-group label .required {
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--gray-700);
    background: var(--white);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 4px var(--primary-50);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input[type="color"] {
    padding: 5px;
    height: 45px;
    cursor: pointer;
}

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

/* Tags Select */
.tags-select {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    min-height: 45px;
}

.tags-select .tag-option {
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.tags-select .tag-option:hover {
    opacity: 0.8;
}

.tags-select .tag-option.selected {
    border-color: var(--gray-800);
}

/* Editor */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-bottom: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    align-items: center;
}

.editor-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    transition: all var(--transition-fast);
    position: relative;
}

.editor-btn:hover {
    background: var(--white);
    color: var(--gray-800);
}

.editor-btn.active {
    background: var(--primary-500);
    color: var(--white);
}

.editor-select {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #888;
    border-radius: 4px;
    background: white;
    color: black;
    font-size: 14px;
    cursor: pointer;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

#fontFamily {
    width: 180px;
}

#fontSize {
    width: 90px;
}

#lineSpacing {
    width: 80px;
}

.editor-select option {
    background: white;
    color: black;
    padding: 10px;
}

.editor-select:hover {
    border-color: #1976D2;
}

.editor-select:focus {
    border-color: #1976D2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.editor-select-small {
    width: 80px;
}

.color-picker-wrapper {
    position: relative;
    display: inline-flex;
}

.color-picker-wrapper input[type="color"] {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.color-btn {
    flex-direction: column;
    gap: 2px;
}

.color-indicator {
    width: 20px;
    height: 4px;
    background: #000000;
    border-radius: 2px;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--gray-300);
    margin: 0 5px;
    align-self: center;
}

.editor-content {
    min-height: 300px;
    padding: 20px;
    border: 2px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    outline: none;
    line-height: 1.6;
    color: var(--gray-700);
}

.editor-content:focus {
    border-color: var(--primary-400);
}

.editor-content:empty:before {
    content: attr(placeholder);
    color: var(--gray-400);
}

.editor-content ul,
.editor-content ol {
    margin: 8px 0;
    padding-left: 25px;
}

.editor-content li {
    margin: 4px 0;
}

.editor-content p {
    margin: 8px 0;
}

.editor-content br + br {
    display: none;
}

.editor-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
}

.editor-content td,
.editor-content th {
    border: 1px solid var(--gray-300);
    padding: 8px;
    min-width: 50px;
}

.editor-content a {
    color: var(--primary-500);
    text-decoration: underline;
}

/* Note detail table styling */
.note-detail-content .note-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
}

.note-detail-content .note-body td,
.note-detail-content .note-body th {
    border: 1px solid var(--gray-300);
    padding: 8px;
}

.note-detail-content .note-body a {
    color: var(--primary-500);
    text-decoration: underline;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--gradient-primary);
    color: var(--white);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-mustard);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 117, 0, 0.5);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--danger);
    color: var(--white);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-danger:hover {
    background: #E53E3E;
}

/* ==================== UPLOAD ==================== */
.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    transition: all var(--transition-fast);
}

.upload-zone.dragover {
    border-color: var(--primary-400);
    background: var(--primary-50);
}

.upload-zone i {
    font-size: 3rem;
    color: var(--primary-400);
    margin-bottom: 15px;
}

.upload-zone p {
    color: var(--gray-600);
    margin-bottom: 15px;
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 10px;
}

.btn-browse {
    display: inline-block;
    padding: 10px 24px;
    background: var(--gradient-primary);
    color: var(--white);
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-browse:hover {
    transform: translateY(-2px);
}

.btn-browse input {
    display: none;
}

.upload-progress {
    padding: 20px;
}

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width var(--transition-fast);
}

#uploadStatus {
    font-size: 0.9rem;
    color: var(--gray-600);
    text-align: center;
}

.upload-list {
    margin-top: 20px;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}

.upload-item i {
    font-size: 1.5rem;
}

.upload-item .file-info {
    flex: 1;
}

.upload-item .file-info h4 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-800);
}

.upload-item .file-info p {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.upload-item .status-icon {
    font-size: 1.2rem;
}

.upload-item .status-icon.success {
    color: var(--success);
}

.upload-item .status-icon.error {
    color: var(--danger);
}

/* ==================== VIEWER ==================== */
.modal-viewer .viewer-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-500);
    color: var(--white);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.btn-download:hover {
    background: var(--primary-600);
}

.viewer-body {
    padding: 0;
    background: var(--gray-900);
}

.viewer-container {
    width: 100%;
    height: calc(95vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.viewer-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.viewer-container video,
.viewer-container audio {
    max-width: 100%;
    max-height: 100%;
}

.viewer-container .doc-preview {
    width: 100%;
    height: 100%;
    background: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.viewer-container .doc-preview i {
    font-size: 4rem;
    color: var(--color-word);
    margin-bottom: 20px;
}

.viewer-container .doc-preview h3 {
    font-size: 1.3rem;
    color: var(--gray-800);
    margin-bottom: 10px;
}

.viewer-container .doc-preview p {
    color: var(--gray-600);
    margin-bottom: 20px;
}

/* ==================== TOAST ==================== */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: toastSlideIn 0.3s ease;
    min-width: 300px;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--info);
}

.toast i {
    font-size: 1.2rem;
}

.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--info); }

.toast span {
    flex: 1;
    color: var(--gray-700);
    font-size: 0.95rem;
}

.toast-close {
    color: var(--gray-400);
    padding: 5px;
}

.toast-close:hover {
    color: var(--gray-600);
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 60px 40px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    grid-column: 1 / -1;
    max-width: 400px;
    margin: 40px auto;
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 20px;
    display: block;
}

.empty-state h3 {
    font-size: 1.3rem;
    color: var(--gray-600);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 25px;
}

.empty-state .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
}

/* ==================== LOADING ==================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        width: var(--sidebar-width);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .content-section {
        padding: 20px;
    }
    
    .main-header {
        padding: 0 20px;
    }
    
    .btn-upload span {
        display: none;
    }
    
    .btn-logout span {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .notes-grid {
        grid-template-columns: 1fr;
    }
    
    .note-detail-content {
        padding: 25px;
    }
    
    .note-detail-content .note-title {
        font-size: 1.5rem;
    }
    
    .alphabet-nav {
        padding: 15px;
    }
    
    .alphabet-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .editor-toolbar {
        gap: 3px;
        padding: 8px;
    }
    
    .editor-select {
        min-width: 80px;
        font-size: 0.75rem;
        padding: 0 5px;
        height: 32px;
    }
    
    .editor-select-small {
        min-width: 50px;
    }
    
    .editor-btn {
        width: 32px;
        height: 32px;
    }
    
    .toolbar-divider {
        margin: 0 3px;
    }
}

@media (max-width: 600px) {
  .content-section {
    padding: 20px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .stat-card {
    padding: 20px;
    gap: 15px;
  }
  
  .stat-icon {
    width: 50px;
    height: 50px;
  }
  
  .stat-info h3 {
    font-size: 0.9rem;
  }
  
  .stat-info p {
    font-size: 0.8rem;
  }
  
  .notes-grid {
    grid-template-columns: 1fr;
  }
  .note-card {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 8px;
    border-radius: 12px;
  }
  .note-card-simple {
    gap: 8px;
    padding: 10px 8px;
  }
  .note-icon-large {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }
  .note-icon-large i {
    font-size: 1rem;
  }
  .note-info-simple h3 {
    font-size: 0.95rem;
  }
  .note-subtitle-card {
    font-size: 0.75rem;
  }
  .note-meta-simple {
    gap: 4px;
  }
  .note-category-badge,
  .note-attachment-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
  }
}

@media (max-width: 480px) {
    .content-section {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 15px 12px;
        border-radius: 12px;
        gap: 12px;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .stat-info h3 {
        font-size: 0.85rem;
        font-weight: 600;
    }
    
    .stat-info p {
        font-size: 0.75rem;
    }
    
    .dashboard-section {
        padding: 15px;
        margin-bottom: 15px;
        border-radius: 12px;
    }
    
    .dashboard-section h2 {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .modal-content {
        border-radius: var(--radius-lg);
    }
    
    .modal-content.modal-fullscreen {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* ==================== COPYRIGHT FOOTER ==================== */
.copyright-footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.85rem;
}

.copyright-footer p {
    margin: 0;
    opacity: 0.9;
}

/* ==================== CATEGORY SETTINGS ==================== */
.category-settings-container {
    max-width: 800px;
    margin: 0 auto;
}

.category-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.category-settings-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-settings-header h2 i {
    color: var(--primary-500);
}

.category-settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-setting-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-fast);
}

.category-setting-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-300);
    transform: translateY(-1px);
}

.category-setting-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.category-setting-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.category-setting-details {
    min-width: 0;
}

.category-setting-details h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-setting-details p {
    font-size: 0.85rem;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-setting-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.category-color-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.category-setting-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-edit-cat,
.btn-delete-cat {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.btn-edit-cat {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.btn-edit-cat:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.1);
}

.btn-delete-cat {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.btn-delete-cat:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

.category-settings-list .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.category-settings-list .empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.category-settings-list .empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-600);
}

.category-settings-list .empty-state p {
    font-size: 0.9rem;
}

#categoryIcon {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    color: var(--gray-800);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

#categoryIcon:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(32, 178, 170, 0.15);
    outline: none;
}

@media (max-width: 768px) {
    .category-setting-item {
        flex-wrap: wrap;
        padding: 14px;
    }
    
    .category-setting-info {
        flex: 1 1 100%;
    }
    
    .category-setting-meta {
        margin-left: 58px;
    }
    
    .category-setting-actions {
        margin-left: auto;
    }
    
    .category-settings-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==================== UTILITY CLASSES ==================== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--gray-500);
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* ==================== Tag Settings ==================== */
.tag-settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tag-settings-list .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.tag-settings-list .empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.tag-settings-list .empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-600);
}

.tag-settings-list .empty-state p {
    font-size: 0.9rem;
}

.tag-setting-preview {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

.tag-preview-container {
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-preview {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    display: inline-block;
    transition: all 0.2s ease;
}
