/* Reset and Base Styles */
:root {
    /* Light theme colors */
    --primary-color: #22c55e;
    --primary-dark: #16a34a;
    --primary-light: #86efac;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dark theme colors */
[data-theme="dark"] {
    --primary-color: #34d399;
    --primary-dark: #059669;
    --primary-light: #6ee7b7;
    --secondary-color: #94a3b8;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #f87171;
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-color: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Page Management */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Logo Styles */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo, .logo-small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.logo-small {
    gap: 10px;
}

.logo-icon {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-small .logo-icon {
    width: 35px;
    height: 35px;
}

.logo-icon .fa-bolt {
    position: absolute;
    font-size: 2.5rem;
    color: var(--primary-color);
    z-index: 2;
    animation: pulse 2s infinite;
}

.logo-small .logo-icon .fa-bolt {
    font-size: 1.8rem;
}

.logo-icon .fa-circle {
    position: absolute;
    font-size: 3rem;
    color: var(--primary-light);
    opacity: 0.3;
    animation: glow 3s ease-in-out infinite alternate;
}

.logo-small .logo-icon .fa-circle {
    font-size: 2.2rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo-small h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    -webkit-text-fill-color: var(--primary-color);
}

.tagline {
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 5px;
    font-size: 0.9rem;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes glow {
    from { opacity: 0.3; transform: scale(1); }
    to { opacity: 0.6; transform: scale(1.1); }
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-form {
    background: var(--bg-color);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 450px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.login-form h1 {
    margin-bottom: 30px;
    color: var(--primary-color);
    font-size: 2rem;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--bg-color);
    color: var(--text-color);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-icon {
    padding: 10px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-color);
}

.btn-icon:hover {
    background: var(--primary-color);
    color: white;
}

/* Error Messages */
.error-message {
    color: var(--danger-color);
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: none;
}

/* Success message */
.success-message {
    background: var(--success-color);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    display: none;
    text-align: center;
}

.success-message.show {
    display: block;
}

/* Form hints and validation */
.form-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    display: block;
}

.form-group input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.form-group input:valid:not(:focus):not(:placeholder-shown) {
    border-color: var(--success-color);
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.1);
}

/* Pages */
.page {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.page.active {
    display: block;
    opacity: 1;
}

/* Smooth page transitions */
.app-loaded .page {
    transition: opacity 0.2s ease-in-out;
}

.app-loaded .page.active {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.demo-info {
    margin-top: 20px;
    padding: 15px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-color);
}

/* Dashboard Styles */
.dashboard-container {
    min-height: 100vh;
    background: var(--bg-secondary);
}

/* Language switcher - Bottom Fixed */
.language-switcher-bottom {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    user-select: none;
}

.language-toggle {
    position: relative;
}

.language-btn {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    min-width: 80px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .language-btn {
    background: rgba(17, 24, 39, 0.95);
}

.language-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.language-btn:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.flag-icon {
    font-size: 1.3em;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.language-text {
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.language-btn i {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.language-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: translateY(10px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 140px;
    margin-bottom: 8px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .language-dropdown {
    background: rgba(17, 24, 39, 0.95);
}

.language-dropdown.show {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.language-dropdown.show ~ .language-toggle .language-btn i {
    transform: rotate(180deg);
}

.language-option {
    width: 100%;
    background: transparent;
    border: none;
    padding: 14px 16px;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    position: relative;
}

.language-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.language-option:hover {
    background: var(--bg-secondary);
    padding-left: 20px;
}

.language-option:hover::before {
    transform: scaleY(1);
}

.language-option:focus {
    outline: none;
    background: var(--bg-secondary);
    padding-left: 20px;
}

.language-option:focus::before {
    transform: scaleY(1);
}

.language-option.active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--primary-color);
    font-weight: 600;
    padding-left: 20px;
}

.language-option.active::before {
    transform: scaleY(1);
}

.language-option .flag-icon {
    font-size: 1.1em;
}

/* Pulse animation for language switcher when page loads */
@keyframes languagePulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.language-btn.pulse {
    animation: languagePulse 2s ease-out;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .language-switcher-bottom {
        bottom: 80px;
        right: 15px;
    }
    
    .language-btn {
        padding: 10px 12px;
        min-width: 70px;
    }
    
    .language-dropdown {
        min-width: 120px;
        right: -10px;
    }
    
    .language-option {
        padding: 12px 14px;
    }
}

/* Ensure language switcher appears above other elements */
.language-switcher-bottom {
    z-index: 9999;
}

.header {
    background: var(--bg-color);
    padding: 20px 30px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
}

.header h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.main-content {
    display: flex;
    min-height: calc(100vh - 80px);
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background: var(--bg-tertiary);
    padding: 20px 0;
    border-right: 1px solid var(--border-color);
}

.nav-menu {
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background: var(--bg-color);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.1);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    color: var(--text-color);
    font-size: 1.8rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Toggle Switch Styles */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 60px;
    height: 30px;
    background: var(--border-color);
    border-radius: 30px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: var(--primary-color);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(30px);
}

.toggle-text {
    font-weight: 500;
    color: var(--text-color);
}

.theme-selector {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 16px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-color);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.stat-card h3 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 5px;
}

.stat-card p {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Notes Section */
.notes-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.notes-list {
    background: var(--bg-color);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow);
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.note-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 8px;
}

.note-item:hover {
    background: var(--bg-secondary);
    transform: translateX(5px);
}

.note-item:last-child {
    border-bottom: none;
}

.note-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}

.note-preview {
    color: var(--text-secondary);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.note-editor {
    background: var(--bg-color);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.note-title-input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    background: var(--bg-color);
    color: var(--text-color);
}

.note-title-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.editor-actions {
    display: flex;
    gap: 10px;
}

#noteContent {
    width: 100%;
    height: 400px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    background: var(--bg-color);
    color: var(--text-color);
}

#noteContent:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Files Section */
.files-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.files-list {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.3s;
}

.file-item:hover {
    background: #f7fafc;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    font-size: 1.5rem;
    color: #667eea;
}

.file-details h4 {
    color: #2d3748;
    margin-bottom: 3px;
}

.file-size {
    font-size: 12px;
    color: #718096;
}

.file-actions {
    display: flex;
    gap: 10px;
}

.drop-zone {
    background: white;
    border: 3px dashed #cbd5e0;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #667eea;
    background: #f0f4ff;
}

.drop-zone i {
    font-size: 3rem;
    color: #cbd5e0;
    margin-bottom: 15px;
}

.drop-zone p {
    color: #718096;
    font-size: 16px;
}

/* Analytics Section */
.analytics-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.chart-container,
.activity-log {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-placeholder {
    height: 200px;
    background: #f7fafc;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #718096;
    margin-top: 15px;
}

.activity-log ul {
    list-style: none;
}

.activity-log li {
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
}

.timestamp {
    color: #718096;
    font-size: 12px;
}

/* Settings Section */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.setting-group {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.setting-group h3 {
    color: #2d3748;
    margin-bottom: 20px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .nav-menu {
        display: flex;
        overflow-x: auto;
    }
    
    .nav-link {
        min-width: 120px;
        justify-content: center;
    }
    
    .notes-container,
    .files-container {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding: 10px 0;
    }
    
    .nav-menu {
        display: flex;
        overflow-x: auto;
        padding: 0 10px;
    }
    
    .nav-link {
        min-width: 120px;
        justify-content: center;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .nav-link:hover,
    .nav-link.active {
        border-left: none;
        border-bottom-color: var(--primary-color);
    }
    
    .notes-container,
    .files-container {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .user-info {
        gap: 10px;
    }
    
    .logo-small h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .content-area {
        padding: 20px 15px;
    }
    
    .login-form {
        padding: 30px 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification improvements */
.notification {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scroll bar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Focus indicators for accessibility */
.btn:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Smooth transitions for theme changes */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* File Preview Modal */
.file-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.file-preview-content {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.file-preview-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.file-preview-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-preview {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-preview:hover {
    background: var(--bg-tertiary);
    color: var(--text-color);
}

.file-preview-body {
    padding: 20px;
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.file-preview-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    display: flex;
    justify-content: flex-end;
}

.loading-spinner {
    color: var(--text-secondary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* File type badges */
.file-type-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 4px;
}

/* Enhanced file items */
.file-item {
    position: relative;
    transition: all 0.2s ease;
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Search and Filter Controls */
.section-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.search-container {
    position: relative;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.filter-container {
    min-width: 150px;
}

.tag-filter {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Tags Functionality */
.tags-container {
    margin: 10px 0;
}

.note-tags-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    display: inline-flex;
    align-items: center;
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    gap: 5px;
}

.tag.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag.clickable:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.tag-remove {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.tag-remove:hover {
    opacity: 1;
}

/* Note items with tags */
.note-tags {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.note-tag {
    background: rgba(34, 197, 94, 0.1);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Analytics Dashboard */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.analytics-card {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.analytics-card h3 {
    margin: 0 0 15px 0;
    color: var(--text-color);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-container {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
}

.usage-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.usage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.usage-item:last-child {
    border-bottom: none;
}

.usage-label {
    font-weight: 500;
    color: var(--text-color);
}

.usage-value {
    color: var(--primary-color);
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

/* Global Search Styles */
.global-search {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
    position: relative;
}

.global-search-input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.global-search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.global-search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.global-search .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 8px;
}

.search-section {
    padding: 12px 0;
}

.search-section:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.search-section h4 {
    padding: 0 16px 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.search-result-item:hover,
.search-result-item.active {
    background: var(--bg-secondary);
    border-left-color: var(--primary-color);
}

.search-result-icon {
    margin-right: 12px;
    color: var(--text-secondary);
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.search-result-content {
    flex: 1;
}

.search-result-content h5 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

.search-result-content p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.search-result-tags {
    margin-top: 4px;
    font-size: 12px;
    color: var(--primary-color);
}

.search-no-results {
    padding: 40px 16px;
    text-align: center;
    color: var(--text-secondary);
}

.search-no-results i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.search-no-results p {
    margin: 0;
    font-size: 14px;
}

/* Highlight for search results */
mark {
    background: var(--primary-color);
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Notes Actions Styles */
.notes-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.notes-actions .btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* File highlight animation */
@keyframes highlight {
    0% { background: transparent; }
    50% { background: var(--primary-color); color: white; }
    100% { background: transparent; }
}

.highlight {
    animation: highlight 2s ease;
}

/* PWA Installation Banner Enhancements */
.pwa-install-banner {
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Enhanced Button Styles */
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Enhanced Loading States */
.loading-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.loading-spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Security Badge */
.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--success-color);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Rate Limit Warning */
.rate-limit-warning {
    background: var(--warning-color);
    color: white;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin: 10px 0;
    font-size: 14px;
    font-weight: 500;
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background: var(--warning-color);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1001;
    display: none;
}

.offline-indicator.show {
    display: block;
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Enhanced Tooltips */
[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-tertiary);
    color: var(--text-color);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: var(--shadow);
    margin-bottom: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .section-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container,
    .filter-container {
        min-width: auto;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .global-search {
        margin: 10px 0;
    }
    
    .notes-actions {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .search-results {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .global-search-input {
        font-size: 14px;
        padding: 10px 15px 10px 40px;
    }
    
    .pwa-banner-content {
        padding: 12px;
    }
    
    .notes-actions .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }
}
