/**
 * Notes Application Styles
 * Extends the design system from style.css
 */

/* ============================================
   GLOBAL SCROLLBAR STYLES
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted-fg);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg);
}

/* ============================================
   LAYOUT
   ============================================ */

.app-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1920px;
    width: 99vw;
    padding: 1rem 3rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--fg);
    margin: 0;
}

.app-title svg {
    width: 24px;
    height: 24px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-main {
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
}

.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
}

.app-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.app-content {
    min-height: 400px;
}

/* ============================================
   BUTTONS & CONTROLS
   ============================================ */

.icon-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--muted);
    border-color: var(--primary);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.icon-btn-small {
    background: transparent;
    border: none;
    color: var(--muted-fg);
    padding: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn-small:hover {
    color: var(--fg);
    background: var(--muted);
}

.icon-btn-small svg {
    width: 14px;
    height: 14px;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-fg);
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--muted);
    color: var(--fg);
    border: 1px solid var(--border);
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg);
    border-color: var(--primary);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-small svg {
    width: 14px;
    height: 14px;
}

.btn-destructive {
    background: var(--destructive);
    color: white;
    border: none;
}

.btn-destructive:hover {
    opacity: 0.9;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: var(--primary-fg);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    z-index: 50;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

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

/* ============================================
   VIEW SWITCHER
   ============================================ */

.view-switcher {
    display: flex;
    gap: 0.25rem;
    background: var(--muted);
    padding: 0.25rem;
    border-radius: 6px;
}

.view-btn {
    background: transparent;
    border: none;
    color: var(--muted-fg);
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.view-btn svg {
    width: 16px;
    height: 16px;
}

.view-btn.active {
    background: var(--bg);
    color: var(--fg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.view-btn:not(.active):hover {
    color: var(--fg);
}

/* ============================================
   DROPDOWN
   ============================================ */

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    display: none;
    z-index: 200;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-item {
    width: 100%;
    padding: 0.625rem 1rem;
    border: none;
    background: transparent;
    color: var(--fg);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: var(--muted);
}

.dropdown-item:first-child {
    border-radius: 6px 6px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 6px 6px;
}

/* ============================================
   THEME SWITCHER
   ============================================ */

[data-theme="dark"] .icon-light {
    display: none;
}

[data-theme="dark"] .icon-dark {
    display: block !important;
}

[data-theme="light"] .icon-dark {
    display: none;
}

/* ============================================
   TABS
   ============================================ */

.tabs {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tab-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--muted-fg);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: left;
}

.tab-btn svg {
    width: 18px;
    height: 18px;
}

.tab-btn:hover {
    background: var(--muted);
    color: var(--fg);
}

.tab-btn.active {
    background: var(--primary);
    color: var(--primary-fg);
}

/* ============================================
   SEARCH
   ============================================ */

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-box svg {
    position: absolute;
    left: 0.75rem;
    width: 16px;
    height: 16px;
    color: var(--muted-fg);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--fg);
    font-size: 0.875rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.clear-search {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--muted-fg);
    padding: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.clear-search:hover {
    background: var(--muted);
    color: var(--fg);
}

.clear-search svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   TAG FILTERS
   ============================================ */

.tag-filters {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted-fg);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-filter-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tag-filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.tag-filter-item:hover {
    background: var(--muted);
}

.tag-filter-item input[type="checkbox"] {
    cursor: pointer;
}

.tag-filter-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.tag-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tag-filter-count {
    font-size: 0.75rem;
    color: var(--muted-fg);
}

/* ============================================
   NOTES CONTAINER
   ============================================ */

.notes-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notes-container.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

/* ============================================
   NOTE CARD
   ============================================ */

.note-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.note-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

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

.note-card-title {
    flex: 1;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--fg);
    margin: 0;
    word-break: break-word;
}

.note-card-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 1;
}

.note-card-action-btn {
    background: transparent;
    border: none;
    color: var(--muted-fg);
    padding: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.note-card-action-btn:hover {
    background: var(--muted);
    color: var(--fg);
}

.note-card-action-btn svg {
    width: 16px;
    height: 16px;
}

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

.note-card-content {
    color: var(--muted-fg);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.note-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.note-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.note-tag {
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.note-card-meta {
    font-size: 0.75rem;
    color: var(--muted-fg);
    white-space: nowrap;
}

/* Note card with color label */
.note-card[data-color]:not([data-color="transparent"]) {
    border-left: 4px solid;
}

/* ============================================
   STATE MESSAGES
   ============================================ */

.state-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.state-icon {
    width: 64px;
    height: 64px;
    color: var(--muted-fg);
    margin-bottom: 1rem;
}

.state-message h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--fg);
    margin: 0 0 0.5rem 0;
}

.state-message p {
    font-size: 1rem;
    color: var(--muted-fg);
    margin: 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--muted);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

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

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-large {
    max-width: 1440px;
}

.modal-fullscreen {
    max-width: 1440px;
    max-height: 95vh;
}

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

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--fg);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

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

/* ============================================
   FORM ELEMENTS
   ============================================ */

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

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

.form-label {
    display: block;
    font-weight: 500;
    color: var(--fg);
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.input-large {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--fg);
    font-size: 1.125rem;
    font-weight: 500;
}

.input-large:focus {
    outline: none;
    border-color: var(--primary);
}

.textarea-large {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--fg);
    font-size: 0.9375rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

.textarea-large:focus {
    outline: none;
    border-color: var(--primary);
}

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

/* ============================================
   COLOR PICKER
   ============================================ */

.color-picker {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.color-swatch[data-color="transparent"] {
    background: linear-gradient(135deg, var(--muted) 25%, transparent 25%, transparent 50%, var(--muted) 50%, var(--muted) 75%, transparent 75%, transparent);
    background-size: 8px 8px;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    border-color: var(--primary);
    border-width: 3px;
}

.color-swatch.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary);
    font-weight: bold;
}

/* ============================================
   TAGS SELECTOR
   ============================================ */

.tags-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tag-checkbox-item:hover {
    background: var(--muted);
}

.tag-checkbox-item input[type="checkbox"] {
    cursor: pointer;
}

.tag-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
}

/* ============================================
   EDITOR TOOLBAR
   ============================================ */

.editor-toolbar {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--muted);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.toolbar-btn {
    background: transparent;
    border: none;
    color: var(--muted-fg);
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.toolbar-btn:hover {
    background: var(--bg);
    color: var(--fg);
}

.toolbar-btn.active {
    background: var(--bg);
    color: var(--primary);
}

.toolbar-btn svg {
    width: 16px;
    height: 16px;
}

.toolbar-divider {
    width: 1px;
    background: var(--border);
    margin: 0 0.25rem;
}

.editor-toolbar + .textarea-large {
    border-radius: 0 0 6px 6px;
}

.content-preview {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0 0 6px 6px;
    background: var(--bg);
    color: var(--fg);
    min-height: 120px;
}

.content-preview strong {
    font-weight: 600;
}

.content-preview em {
    font-style: italic;
}

.content-preview ul,
.content-preview ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

/* ============================================
   CHECKBOX LISTS
   ============================================ */

.checkbox-lists-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-list {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
}

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

.checkbox-list-title {
    flex: 1;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--fg);
    font-weight: 500;
}

.checkbox-list-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.checkbox-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-list-item input[type="checkbox"] {
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-list-item-input {
    flex: 1;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--fg);
}

.checkbox-list-item.checked .checkbox-list-item-input {
    text-decoration: line-through;
    opacity: 0.6;
}

.add-item-btn {
    width: 100%;
    padding: 0.375rem;
    border: 1px dashed var(--border);
    background: transparent;
    color: var(--muted-fg);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.add-item-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg);
}

/* ============================================
   COPY BOXES
   ============================================ */

.copyboxes-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.copybox {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
}

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

.copybox-label {
    flex: 1;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--fg);
    font-weight: 500;
}

.copybox-content-wrapper {
    position: relative;
}

.copybox-content {
    width: 100%;
    padding: 0.75rem;
    padding-right: 3rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--fg);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 80px;
}

.copybox-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary);
    color: var(--primary-fg);
    border: none;
    padding: 0.375rem;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.copybox-copy-btn:hover {
    opacity: 0.9;
}

.copybox-copy-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   TAG MANAGER
   ============================================ */

.add-tag-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.add-tag-form input[type="text"] {
    flex: 1;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--fg);
}

.add-tag-form input[type="color"] {
    width: 48px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    background: var(--bg);
}

.add-tag-form button {
    padding: 0.625rem 1rem;
}

.tags-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tag-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.tag-item-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
}

.tag-item-name {
    flex: 1;
    font-weight: 500;
    color: var(--fg);
}

.tag-item-actions {
    display: flex;
    gap: 0.25rem;
}

/* ============================================
   FOCUS MODE
   ============================================ */

.focus-mode-header {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.focus-mode-body {
    padding: 3rem;
    overflow-y: auto;
    max-width: 800px;
    margin: 0 auto;
}

.focus-mode-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 1.5rem;
}

.focus-mode-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--fg);
}

.focus-mode-content strong {
    font-weight: 600;
}

.focus-mode-content em {
    font-style: italic;
}

.focus-mode-content ul,
.focus-mode-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.focus-mode-meta {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--primary);
    color: var(--primary-fg);
    padding: 0.875rem 1.25rem;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    animation: slideUp 0.3s ease;
}

.toast.success {
    background: var(--status-done);
    color: white;
}

.toast.error {
    background: var(--destructive);
    color: white;
}

.toast svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

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

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        order: 2;
    }

    .app-content {
        order: 1;
    }

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

    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .focus-mode-body {
        padding: 2rem 1.5rem;
    }

    .fab {
        bottom: 1rem;
        right: 1rem;
    }

    .header-content {
        flex-wrap: wrap;
    }

    .app-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .header-right {
        flex-wrap: wrap;
    }

    .view-switcher {
        order: 3;
        width: 100%;
    }

    .note-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

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

.text-primary {
    color: var(--primary);
}

.text-destructive {
    color: var(--destructive);
}

/* ============================================
   COLLAPSIBLE SECTIONS
   ============================================ */

.collapsible-section {
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 1rem;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.collapsible-header:hover {
    background: var(--muted);
}

.collapsible-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collapsible-header-left svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.collapsible-section.collapsed .collapsible-header-left svg {
    transform: rotate(-90deg);
}

.collapsible-title {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--fg);
}

.collapsible-content {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.collapsible-section.collapsed .collapsible-content {
    display: none;
}

/* ============================================
   STATUS COLORS
   ============================================ */

.status-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.status-option {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    background: var(--bg);
}

.status-option:hover {
    transform: translateY(-1px);
}

.status-option.active {
    border-width: 2px;
}

.status-option[data-status="open"] {
    color: #8b5cf6;
    border-color: #8b5cf6;
}

.status-option[data-status="open"].active {
    background: #f3e8ff;
}

[data-theme="dark"] .status-option[data-status="open"].active {
    background: rgba(139, 92, 246, 0.2);
}

.status-option[data-status="done"] {
    color: #22c55e;
    border-color: #22c55e;
}

.status-option[data-status="done"].active {
    background: #dcfce7;
}

[data-theme="dark"] .status-option[data-status="done"].active {
    background: rgba(34, 197, 94, 0.2);
}

.status-option[data-status="abandoned"] {
    color: #ef4444;
    border-color: #ef4444;
}

.status-option[data-status="abandoned"].active {
    background: #fee2e2;
}

[data-theme="dark"] .status-option[data-status="abandoned"].active {
    background: rgba(239, 68, 68, 0.2);
}

.status-option[data-status="overwritten"] {
    color: #f97316;
    border-color: #f97316;
}

.status-option[data-status="overwritten"].active {
    background: #ffedd5;
}

[data-theme="dark"] .status-option[data-status="overwritten"].active {
    background: rgba(249, 115, 22, 0.2);
}

.status-option[data-status="planned"] {
    color: #6b7280;
    border-color: #6b7280;
}

.status-option[data-status="planned"].active {
    background: #f3f4f6;
}

[data-theme="dark"] .status-option[data-status="planned"].active {
    background: rgba(107, 114, 128, 0.2);
}

.status-option[data-status="random"] {
    color: #3b82f6;
    border-color: #3b82f6;
}

.status-option[data-status="random"].active {
    background: #dbeafe;
}

[data-theme="dark"] .status-option[data-status="random"].active {
    background: rgba(59, 130, 246, 0.2);
}

/* Status badge on note cards */
.note-status-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.note-status-badge.status-open {
    color: #8b5cf6;
    background: #f3e8ff;
}

[data-theme="dark"] .note-status-badge.status-open {
    background: rgba(139, 92, 246, 0.2);
}

.note-status-badge.status-done {
    color: #22c55e;
    background: #dcfce7;
}

[data-theme="dark"] .note-status-badge.status-done {
    background: rgba(34, 197, 94, 0.2);
}

.note-status-badge.status-abandoned {
    color: #ef4444;
    background: #fee2e2;
}

[data-theme="dark"] .note-status-badge.status-abandoned {
    background: rgba(239, 68, 68, 0.2);
}

.note-status-badge.status-overwritten {
    color: #f97316;
    background: #ffedd5;
}

[data-theme="dark"] .note-status-badge.status-overwritten {
    background: rgba(249, 115, 22, 0.2);
}

.note-status-badge.status-planned {
    color: #6b7280;
    background: #f3f4f6;
}

[data-theme="dark"] .note-status-badge.status-planned {
    background: rgba(107, 114, 128, 0.2);
}

.note-status-badge.status-random {
    color: #3b82f6;
    background: #dbeafe;
}

[data-theme="dark"] .note-status-badge.status-random {
    background: rgba(59, 130, 246, 0.2);
}

/* ============================================
   TEXTAREA SIZING
   ============================================ */

#note-content-input {
    min-height: 300px;
    max-height: 600px;
}
