@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-primary: #0f0f11;
    --bg-secondary: #18181c;
    --bg-tertiary: #24242b;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent: #e11d48;
    --accent-gradient: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
    --accent-glow: rgba(225, 29, 72, 0.35);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(225, 29, 72, 0.5);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
    
    /* Sticky notes color palette */
    --note-blue: #1d3557;
    --note-green: #1b4332;
    --note-yellow: #5c4d00;
    --note-red: #591a1a;
    --note-purple: #3c1642;
    --note-default: #24242b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* App Layout */
.app-container {
    max-width: 768px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* Header Section */
header {
    margin-bottom: 24px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.brand-icon svg {
    width: 22px;
    height: 22px;
    fill: #ffffff;
}

.brand-name {
    font-size: 24px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

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

/* Sync Badge Status */
.sync-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sync-badge.syncing {
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
    background-color: rgba(59, 130, 246, 0.05);
}

.sync-badge.success {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
    background-color: rgba(16, 185, 129, 0.05);
}

.sync-badge.error {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    background-color: rgba(239, 68, 68, 0.05);
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-secondary);
}

.syncing .sync-dot {
    background-color: #3b82f6;
    animation: pulse 1.2s infinite;
}

.success .sync-dot {
    background-color: #10b981;
}

.error .sync-dot {
    background-color: #ef4444;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}

/* Search bar */
.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    height: 48px;
    padding: 12px 16px 12px 48px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

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

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Notes Section */
.section-title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    margin-top: 10px;
}

.section-title {
    font-size: 18px;
    color: var(--text-primary);
}

.layout-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.layout-toggle:active {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Notes Grid/List */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    transition: all 0.3s ease;
}

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

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background-color: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 20px;
    margin-top: 10px;
}

.empty-icon {
    width: 64px;
    height: 64px;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.empty-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 260px;
}

/* Note Card */
.note-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.note-card:active {
    transform: scale(0.97);
}

/* Color accents on left edge of note */
.note-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background-color: var(--accent);
}

.note-card.color-default::before { background-color: var(--text-secondary); }
.note-card.color-blue::before { background-color: #3b82f6; }
.note-card.color-green::before { background-color: #10b981; }
.note-card.color-yellow::before { background-color: #f59e0b; }
.note-card.color-red::before { background-color: #ef4444; }
.note-card.color-purple::before { background-color: #8b5cf6; }

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}

.note-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.note-body {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    white-space: pre-wrap;
}

.list-view .note-body {
    -webkit-line-clamp: 2;
}

.note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 8px;
}

/* Floating Action Button */
.fab {
    position: fixed;
    right: 20px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    z-index: 99;
    transition: all 0.2s ease;
}

.fab:active {
    transform: scale(0.9) rotate(45deg);
}

.fab svg {
    width: 24px;
    height: 24px;
}

/* Fullscreen Modal / Sheet */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: flex-end; /* Bottom sheet on mobile */
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    background-color: var(--bg-secondary);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-bottom: none;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

@media (min-width: 600px) {
    .modal-overlay {
        align-items: center;
    }
    .modal-content {
        border-radius: 24px;
        border-bottom: 1px solid var(--border-color);
        max-height: 80vh;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    padding: 4px;
}

.modal-body {
    overflow-y: auto;
    flex-grow: 1;
    padding-bottom: 20px;
}

/* Form fields */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--border-focus);
}

textarea.form-input {
    min-height: 120px;
    resize: none;
    font-family: inherit;
}

/* Color selector */
.color-picker {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.color-option.selected {
    border-color: #ffffff;
    transform: scale(1.15);
}

.color-option[data-color="default"] { background-color: var(--bg-tertiary); border: 2px solid var(--border-color); }
.color-option[data-color="default"].selected { border-color: #ffffff; }
.color-option[data-color="blue"] { background-color: #3b82f6; }
.color-option[data-color="green"] { background-color: #10b981; }
.color-option[data-color="yellow"] { background-color: #f59e0b; }
.color-option[data-color="red"] { background-color: #ef4444; }
.color-option[data-color="purple"] { background-color: #8b5cf6; }

/* Modal actions */
.modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.btn {
    flex: 1;
    height: 48px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.btn-secondary:active {
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:active {
    opacity: 0.9;
    transform: scale(0.98);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    flex: 0 0 auto;
    width: 48px;
}

.btn-danger:active {
    background-color: rgba(239, 68, 68, 0.25);
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: rgba(24, 24, 28, 0.95);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    max-width: 90%;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   LANDING PAGE (www/index.html) STYLES
   ========================================================================== */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 80vh;
    padding: 40px 20px;
}

.hero-logo {
    width: 96px;
    height: 96px;
    background: var(--accent-gradient);
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px var(--accent-glow);
    margin-bottom: 32px;
}

.hero-logo svg {
    width: 54px;
    height: 54px;
    fill: #ffffff;
}

.hero-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.8px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 320px;
    margin-bottom: 40px;
}

.cta-group {
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==========================================================================
   LOGIN PAGE (www/login.html) STYLES
   ========================================================================== */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 90vh;
    padding: 24px 16px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-icon {
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.login-icon svg {
    width: 30px;
    height: 30px;
    fill: #ffffff;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-btn-submit {
    margin-top: 10px;
    width: 100%;
}

.back-link-container {
    text-align: center;
    margin-top: 20px;
}

.back-link-container a {
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s;
}

.back-link-container a:active {
    color: var(--accent);
}

.error-message {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
    display: none;
    text-align: center;
}

/* ==========================================================================
   NATIVE APP EXPERIENCE ENHANCEMENTS
   ========================================================================== */

/* Tránh cuộn toàn trang & chặn elastic scrolling */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    overscroll-behavior: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Layout container khớp hoàn toàn khung di động */
.app-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--bg-primary);
    position: relative;
}

/* Header cố định ở trên */
.app-header-fixed {
    flex-shrink: 0;
    background-color: var(--bg-primary);
    padding: 20px 16px 12px 16px;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}

header {
    margin-bottom: 0 !important;
}

/* Vùng nội dung cuộn độc lập cho Ghi chú */
.app-content-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* Ẩn scrollbar */
.app-content-scrollable::-webkit-scrollbar {
    display: none;
}

/* Sắp xếp danh sách note */
.notes-grid {
    margin-top: 0 !important;
}

/* Touch active feedback cho trải nghiệm giống Native App */
.note-card:active,
.btn:active,
.fab:active,
.layout-toggle:active,
.close-btn:active,
.color-option:active {
    transform: scale(0.96);
    opacity: 0.85;
    transition: transform 0.05s ease;
}

/* Splash Screen khởi động toàn màn hình */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.splash-logo {
    width: 84px;
    height: 84px;
    background: var(--accent-gradient);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px var(--accent-glow);
    margin-bottom: 24px;
    animation: splashPulse 1.8s infinite ease-in-out;
}

.splash-logo svg {
    width: 44px;
    height: 44px;
    fill: #ffffff;
}

.splash-loader {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes splashPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); box-shadow: 0 15px 40px rgba(99, 102, 241, 0.5); }
    100% { transform: scale(1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Skeleton Loader (Shimmer Effect) */
.skeleton-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
}

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

.skeleton-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 16px;
    min-height: 140px;
    position: relative;
    overflow: hidden;
}

.skeleton-line {
    height: 14px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.skeleton-line.title {
    width: 70%;
    height: 18px;
}

.skeleton-line.body-1 {
    width: 90%;
}

.skeleton-line.body-2 {
    width: 50%;
    margin-bottom: 24px;
}

.skeleton-line.footer {
    width: 40%;
    height: 10px;
    margin-bottom: 0;
}

/* Hiệu ứng nhấp nháy shimmer */
.skeleton-card .skeleton-line::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.03) 20%,
        rgba(255, 255, 255, 0.06) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Offline & Connection Error Overlay */
.error-overlay {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    height: 100%;
}

.error-overlay.active {
    display: flex;
}

.error-icon {
    width: 72px;
    height: 72px;
    background-color: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: #ef4444;
}

.error-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.error-desc {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 280px;
    margin-bottom: 28px;
}

.error-retry-btn {
    max-width: 160px;
}

/* ==========================================================================
   FULLSCREEN MODAL FOR NOTE EDITOR & CKEDITOR DARK STYLES
   ========================================================================== */

/* Note Editor Modal Fullscreen */
#note-modal.modal-overlay {
    align-items: stretch;
    background-color: var(--bg-primary);
}

#note-modal .modal-content {
    width: 100% !important;
    height: 100% !important;
    max-height: 100vh !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    padding: 20px 16px;
}

/* Form layout inside fullscreen modal */
#note-modal .modal-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#note-modal #note-form {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#note-modal #note-form .form-group:nth-child(3) {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 24px;
}

#note-modal #note-form .form-group:nth-child(3) .ck-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#note-modal #note-form .form-group:nth-child(3) .ck-editor__main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#note-modal #note-form .form-group:nth-child(3) .ck-content {
    flex: 1;
}

/* CKEditor 5 Dark Theme Customization */
.ck-editor__editable_inline {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    border-bottom-left-radius: 12px !important;
    border-bottom-right-radius: 12px !important;
    padding: 12px 16px !important;
}

.ck-editor__editable_inline:focus {
    border-color: var(--border-focus) !important;
    box-shadow: none !important;
}

.ck.ck-toolbar {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
}

.ck.ck-button {
    color: var(--text-secondary) !important;
    cursor: pointer !important;
}

.ck.ck-button:hover, .ck.ck-button:active, .ck.ck-button.ck-on {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

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

.ck.ck-button.ck-on .ck-icon {
    color: var(--accent) !important;
}

.ck.ck-dropdown__panel {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

.ck.ck-dropdown__panel::-webkit-scrollbar {
    display: none;
}

.ck.ck-list {
    background-color: var(--bg-secondary) !important;
}

.ck.ck-list__item .ck-button:hover {
    background-color: var(--bg-tertiary) !important;
}

/* Mobile Responsive Header Optimization */
@media (max-width: 480px) {
    .app-header-fixed {
        padding: 16px 12px 10px 12px;
    }
    
    .brand {
        gap: 8px;
    }
    
    .brand-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }
    
    .brand-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .brand-name {
        font-size: 20px;
    }
    
    .header-actions {
        gap: 6px;
    }
    
    /* Transform sync badge to a clean circular status dot indicator */
    .sync-badge {
        width: 32px;
        height: 32px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
        cursor: pointer;
        flex-shrink: 0;
        flex-grow: 0;
    }
    
    .sync-badge #sync-text {
        display: none;
    }
    
    .sync-dot {
        width: 10px;
        height: 10px;
    }
    
    /* Optimize buttons style on mobile to match the badge */
    .header-actions .layout-toggle {
        width: 32px;
        height: 32px;
        padding: 0;
        border-radius: 50% !important;
        flex-shrink: 0;
        flex-grow: 0;
    }
    
    .header-actions .layout-toggle svg {
        width: 16px;
        height: 16px;
    }
}

/* Floating Language Switch Button for index and login pages */
.lang-switch-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(24, 24, 28, 0.7);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
}

.lang-switch-floating:active {
    transform: scale(0.92);
    background-color: rgba(24, 24, 28, 0.95);
    color: var(--accent);
    border-color: var(--border-focus);
}

