* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e60023;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Sync Status Indicator */
.sync-status {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sync-status.show {
    opacity: 1;
    transform: translateY(0);
}

.sync-status.success {
    background: rgba(76, 175, 80, 0.9);
    color: white;
}

.sync-status.error {
    background: rgba(244, 67, 54, 0.9);
    color: white;
}

/* Top Bar */
.top-bar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 15px 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-brand {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(45deg, #e60023, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.nav-menu {
    display: flex;
    gap: 25px;
    margin: 0 20px;
}

.nav-option {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #e60023, #ff6b6b);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.nav-option:hover::before,
.nav-option.active::before {
    left: 0;
}

.nav-option:hover,
.nav-option.active {
    color: #fff;
    transform: translateY(-2px);
}

.search-container {
    max-width: 400px;
    width: 100%;
    position: relative;
}

.search-container input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
}

.search-container input:focus {
    background: rgba(255, 255, 255, 0.95);
    outline: none;
    box-shadow: 0 0 20px rgba(230, 0, 35, 0.2);
    transform: scale(1.02);
}

.search-container::after {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

/* Data Controls (Export/Import) */
.data-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.export-btn,
.import-btn {
    background: linear-gradient(45deg, #e60023, #ff6b6b);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(230, 0, 35, 0.3);
}

.export-btn:hover,
.import-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(230, 0, 35, 0.4);
}

.sync-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 14px;
    color: #666;
}

.sync-indicator i {
    font-size: 16px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(230, 0, 35, 0.1);
}

/* Layout */
.layout {
    display: flex;
    margin-top: 80px;
    min-height: calc(100vh - 80px);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 80px;
    left: -280px;
    width: 280px;
    height: calc(100vh - 80px);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 25px;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 900;
    overflow-y: auto;
}

.sidebar.open {
    left: 0;
}

.sidebar-search {
    margin-bottom: 25px;
    position: relative;
}

.sidebar-search input {
    width: 100%;
    padding: 15px 45px 15px 15px;
    border: 2px solid transparent;
    border-radius: 15px;
    background: rgba(246, 246, 246, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
}

.sidebar-search input:focus {
    border-color: #e60023;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 15px rgba(230, 0, 35, 0.1);
}

.sidebar-search::after {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.nav-sections {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(246, 246, 246, 0.6);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.nav-section:hover {
    background: linear-gradient(45deg, #e60023, #ff6b6b);
    color: #fff;
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-section .delete-section-btn {
    background: rgba(230, 0, 35, 0.2);
    color: #e60023;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0.8);
}

.nav-section:hover .delete-section-btn {
    opacity: 1;
    transform: scale(1);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.nav-add {
    margin-top: 30px;
    background: rgba(246, 246, 246, 0.4);
    padding: 20px;
    border-radius: 20px;
    border: 2px dashed #ddd;
    transition: all 0.3s ease;
}

.nav-add:hover {
    border-color: #e60023;
    background: rgba(230, 0, 35, 0.05);
}

.nav-add input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.nav-add input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 15px rgba(230, 0, 35, 0.1);
}

.nav-add button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #e60023, #ff6b6b);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-add button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s ease;
}

.nav-add button:hover::before {
    left: 100%;
}

.nav-add button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(230, 0, 35, 0.3);
}

/* Toggle Button */
.toggle-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: linear-gradient(45deg, #e60023, #ff6b6b);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(230, 0, 35, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
}

.toggle-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 35px rgba(230, 0, 35, 0.4);
}

.toggle-btn i {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-btn.open i {
    transform: rotate(180deg);
}

/* Container */
.container {
    margin-left: 0;
    max-width: 1200px;
    padding: 30px;
    columns: 3;
    column-gap: 30px;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: calc(100vh - 140px);
}

body.sidebar-open .container {
    margin-left: 300px;
}

/* Section and Note Styling */
.section {
    break-inside: avoid;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }

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

.section h2 {
    background: linear-gradient(45deg, #e60023, #ff6b6b);
    color: #fff;
    padding: 20px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.section h2::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.8s ease;
}

.section:hover h2::before {
    left: 100%;
}

.notes {
    padding: 20px;
}

.note,
.diary-entry {
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(230, 0, 35, 0.1);
    cursor: pointer;
}

.note:hover,
.diary-entry:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(230, 0, 35, 0.3);
}

.note h3 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
}

.note p,
.diary-entry p {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.note.hidden,
.diary-entry.hidden {
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    transform: scale(0.8);
}

.delete-btn,
.edit-btn {
    position: absolute;
    top: 15px;
    right: 45px;
    background: rgba(230, 0, 35, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0.8);
}

.edit-btn {
    right: 15px;
    background: rgba(52, 152, 219, 0.9);
}

.note:hover .delete-btn,
.note:hover .edit-btn,
.diary-entry:hover .delete-btn,
.diary-entry:hover .edit-btn {
    opacity: 1;
    transform: scale(1);
}

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

.edit-btn:hover {
    background: #2980b9;
    transform: scale(1.1);
}

/* Add Note Form */
.add-note {
    padding: 20px;
    background: rgba(246, 246, 246, 0.6);
    backdrop-filter: blur(10px);
}

.add-note input,
.add-note textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
}

.add-note input:focus,
.add-note textarea:focus {
    outline: none;
    border-color: #e60023;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 15px rgba(230, 0, 35, 0.1);
    transform: scale(1.02);
}

.add-note textarea {
    height: 100px;
    resize: vertical;
    font-family: inherit;
}

.add-note button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #e60023, #ff6b6b);
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.add-note button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s ease;
}

.add-note button:hover::before {
    left: 100%;
}

.add-note button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(230, 0, 35, 0.3);
}

/* Diary Specific Styling */
.diary-entry {
    background: linear-gradient(135deg, #fff 0%, #f8f9ff 100%);
    width: 320px;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
}

.diary-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    padding: 20px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.diary-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diary-greeting {
    font-family: 'Brush Script MT', 'Segoe Script', cursive;
    color: #fff;
    font-size: 24px;
    font-weight: 400;
}

.mood-badge {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    animation: moodPulse 2s ease-in-out infinite;
}

@keyframes moodPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.diary-header input[type="date"] {
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    font-size: 14px;
    color: #fff;
    padding: 5px;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 20px 10px 20px;
    margin-top: -10px;
}

.tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.diary-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.mood-select,
.tags-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    font-size: 14px;
}

.mood-select:focus,
.tags-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.2);
}

.diary-entry p {
    line-height: 1.8;
    color: #2c3e50;
    font-size: 16px;
    flex-grow: 1;
    margin-bottom: 20px;
    padding: 20px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="1" height="30"><line x1="0" y1="30" x2="1" y2="30" stroke="%23e1e5e9" stroke-width="1"/></svg>') repeat-y;
    padding-left: 40px;
}

/* Pop-up Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: #fff;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(30px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.popup-overlay.active .popup-content {
    transform: scale(1) translateY(0);
}

.popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.popup-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
}

.popup-title i {
    font-size: 24px;
}

.popup-close {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 18px;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

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

.form-group {
    margin-bottom: 20px;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group label i {
    color: #667eea;
    font-size: 16px;
}

.popup-input,
.popup-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    background: #f8f9fa;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.popup-input:focus,
.popup-textarea:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.popup-textarea {
    resize: vertical;
    line-height: 1.6;
    min-height: 200px;
}

.mood-select {
    cursor: pointer;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

.entry-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6c757d;
    margin-top: 10px;
}

.entry-meta i {
    font-size: 12px;
}

.popup-footer {
    padding: 20px 25px;
    background: #f8f9fa;
    border-top: 1px solid #e1e8ed;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #fff;
    color: #6c757d;
    border: 2px solid #e1e8ed;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #cbd3da;
}

/* Editing Mode */
.editing .notes {
    display: none;
}

.editing .add-note {
    padding: 25px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 350px;
    min-height: 450px;
    overflow-y: auto;
    border: 2px solid rgba(230, 0, 35, 0.1);
}

.editing .add-note textarea {
    height: 300px;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .container {
        columns: 2;
        padding: 20px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .search-container {
        max-width: 250px;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 12px 15px;
        flex-wrap: wrap;
    }
    
    .nav-brand {
        font-size: 24px;
    }
    
    .search-container {
        order: 3;
        width: 100%;
        margin-top: 15px;
        max-width: none;
    }
    
    .container {
        columns: 1;
        padding: 15px;
        margin-top: 120px;
    }
    
    body.sidebar-open .container {
        margin-left: 0;
    }
    
    .sidebar {
        width: 100%;
        left: -100%;
    }
    
    .toggle-btn {
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .section {
        margin-bottom: 20px;
    }
    
    .diary-entry {
        width: 100%;
        height: auto;
        min-height: 300px;
    }
    
    .popup-content {
        width: 95%;
        height: 90%;
        margin: 20px;
        border-radius: 20px;
    }
    
    .popup-content .header {
        padding: 20px;
        font-size: 20px;
    }
    
    .popup-content .content {
        padding: 20px;
    }
    
    .popup-content .content textarea {
        height: 250px;
    }
    
    .sync-status {
        top: 130px;
        right: 15px;
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .editing .add-note {
        width: 100%;
        min-height: 350px;
    }
    
    .editing .add-note textarea {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .top-bar {
        padding: 10px 12px;
    }
    
    .nav-brand {
        font-size: 20px;
    }
    
    .container {
        padding: 10px;
        margin-top: 140px;
    }
    
    .section h2 {
        font-size: 18px;
        padding: 15px;
    }
    
    .notes,
    .add-note {
        padding: 15px;
    }
    
    .note,
    .diary-entry {
        padding: 15px;
        margin-bottom: 12px;
    }
    
    .note h3 {
        font-size: 16px;
    }
    
    .note p,
    .diary-entry p {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .delete-btn,
    .edit-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
        top: 12px;
    }
    
    .edit-btn {
        right: 12px;
    }
    
    .delete-btn {
        right: 42px;
    }
    
    .toggle-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
        bottom: 15px;
        left: 15px;
    }
    
    .sidebar {
        padding: 20px;
    }
    
    .nav-section {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .nav-add {
        padding: 15px;
        margin-top: 20px;
    }
    
    .nav-add input,
    .nav-add button {
        padding: 12px;
        font-size: 14px;
    }
    
    .popup-content {
        width: 98%;
        height: 95%;
        margin: 10px;
        border-radius: 15px;
    }
    
    .popup-content .header {
        padding: 15px;
        font-size: 18px;
    }
    
    .popup-content .content {
        padding: 15px;
    }
    
    .popup-content .content input,
    .popup-content .content textarea {
        padding: 12px;
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .popup-content .content textarea {
        height: 200px;
    }
    
    .popup-content .update-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .diary-entry .header {
        padding: 15px;
    }
    
    .diary-entry .header span {
        font-size: 20px;
    }
    
    .diary-entry p {
        padding: 15px;
        font-size: 14px;
        line-height: 1.6;
    }
    
    .sync-status {
        top: 150px;
        right: 10px;
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Additional Mobile Optimizations */
@media (max-height: 600px) {
    .popup-content {
        height: 98%;
    }
    
    .popup-content .content textarea {
        height: 150px;
    }
    
    .container {
        min-height: auto;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        margin-top: 100px;
    }
    
    .popup-content {
        width: 90%;
        height: 85%;
    }
    
    .popup-content .content textarea {
        height: 180px;
    }
}

/* Print Styles */
@media print {
    .top-bar,
    .sidebar,
    .toggle-btn,
    .delete-btn,
    .edit-btn,
    .add-note,
    .sync-status,
    .loading-overlay {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .container {
        margin: 0 !important;
        padding: 20px !important;
        columns: 1 !important;
    }
    
    .section {
        break-inside: avoid;
        margin-bottom: 20px;
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ccc;
    }
    
    .section h2 {
        background: #f0f0f0 !important;
        color: black !important;
    }
    
    .note,
    .diary-entry {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #ddd;
        margin-bottom: 10px;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .section,
    .note,
    .diary-entry {
        border: 2px solid #000;
    }
    
    .nav-option:hover,
    .nav-section:hover {
        background: #000 !important;
        color: #fff !important;
    }
    
    .add-note button,
    .popup-content .update-btn {
        background: #000 !important;
        border: 2px solid #fff;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
    
    .top-bar {
        background: rgba(0, 0, 0, 0.8);
        color: #fff;
    }
    
    .nav-option {
        color: #fff;
    }
    
    .search-container input {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    .search-container input::placeholder {
        color: rgba(255, 255, 255, 0.6);
    }
    
    .sidebar {
        background: rgba(0, 0, 0, 0.8);
        color: #fff;
    }
    
    .section {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    .note,
    .diary-entry {
        background: rgba(255, 255, 255, 0.05);
        color: #fff;
    }
    
    .note h3 {
        color: #fff;
    }
    
    .note p,
    .diary-entry p {
        color: rgba(255, 255, 255, 0.8);
    }
}