/* ================================================
   STYLE.CSS — Todo App (Light Dashboard Theme)
   ================================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

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

:root {
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --bg:       #f5f5f7;
    --surface:  #ffffff;
    --border:   #e5e7eb;

    --text-1:   #111827;
    --text-2:   #6b7280;
    --text-3:   #9ca3af;

    --black:    #0f172a;
    --blue:     #2563eb;
    --green:    #10b981;
    --red:      #ef4444;
    --purple:   #8b5cf6;

    --radius:   12px;
    --radius-sm: 8px;
}

/* === RESPONSIVE UTILITIES === */
.desktop-only { display: flex !important; }
.mobile-only  { display: none !important; }

@media (max-width: 1024px) {
    .desktop-only { display: none !important; }
    .mobile-only  { display: flex !important; }
}

html, body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-1);
    -webkit-font-smoothing: antialiased;
    transition: font-family 0.3s ease;
}

/* === APP SHELL (3-column grid) === */
#app-shell {
    display: grid;
    grid-template-columns: 64px 260px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* === ICON RAIL === */
#icon-rail {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    gap: 8px;
}

.rail-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-3);
    cursor: pointer;
    transition: all .15s ease;
}

.rail-icon:hover {
    color: var(--text-1);
    background: var(--bg);
}

.rail-icon.active {
    color: var(--blue);
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.2);
}

.rail-icon-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    flex: 1;
}

.rail-icon-fab {
    margin-top: auto;
    background: var(--black);
    color: #fff;
    border-color: var(--black);
}

.rail-icon-fab:hover {
    background: #1e293b;
    color: #fff;
}

/* === SIDEBAR === */
#sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-top { flex: 1; }

.sidebar-header-icon-box {
    width: 38px;
    height: 38px;
    background: var(--bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue);
    flex-shrink: 0;
}

.sidebar-project {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 28px 24px 20px;
}

.project-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-1);
}

.project-id {
    font-size: 12px;
    color: var(--text-3);
    font-weight: 500;
}

/* Sidebar Nav */
.sidebar-nav {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    transition: all .15s ease;
}

.nav-link svg {
    flex-shrink: 0;
    color: var(--text-3);
}

.nav-link:hover {
    background: var(--bg);
    color: var(--text-1);
}

.nav-link.active {
    background: var(--bg);
    color: var(--text-1);
    font-weight: 600;
}

.nav-link.active svg {
    color: var(--text-1);
}

/* Sidebar Bottom (Profile) */
.sidebar-bottom {
    border-top: 1px solid var(--border);
    padding: 16px 16px;
}

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

.profile-row img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-email {
    font-size: 11px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-menu-btn {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.profile-menu-btn:hover { color: var(--red); }

/* === MAIN AREA === */
#main-area {
    padding: 36px 48px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.main-header {
    margin-bottom: 24px;
}

.main-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-1);
}

/* Font Selector */
.font-dropdown {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    font-size: 13px;
    color: var(--text-2);
    outline: none;
    cursor: pointer;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
}

.filter-chip {
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    transition: all .15s ease;
}

.filter-chip:hover {
    background: var(--bg);
}

.filter-chip.active {
    background: var(--black);
    color: #fff;
    border-color: var(--black);
}

/* Composer */
.composer {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.composer-top {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

#todo-input, .composer-input {
    flex: 1;
    border: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-1);
    outline: none;
    background: transparent;
    min-width: 0; /* Prevents flex items from growing too large */
}

#todo-input::placeholder, .composer-input::placeholder { color: var(--text-3); }

#add-btn, .composer-submit-btn {
    padding: 8px 20px;
    background: var(--black);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

#add-btn:hover, .composer-submit-btn:hover {
    background: #1e293b;
}

.composer-details {
    display: flex;
    gap: 12px;
}

.composer-details input,
.composer-details select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-2);
    background: var(--bg);
    outline: none;
}

#memo-input { flex: 1; }

/* Search */
.search-wrapper {
    position: relative;
    margin-bottom: 24px;
}

.search-svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
}

#search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-1);
    outline: none;
}

#search-input:focus { border-color: var(--blue); }
#search-input::placeholder { color: var(--text-3); }

/* === TASK LIST (vertical stack, like reference) === */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    list-style: none;
}

/* Task Card */
.task-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    transition: box-shadow .2s ease;
    animation: fadeSlideUp .3s ease;
}

.task-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.task-card.completed { opacity: 0.6; }

.task-card.completed .tc-title {
    text-decoration: line-through;
    color: var(--text-3);
}

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

/* Card inner layout */
.tc-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.tc-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-1);
}

.tc-status {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 3px;
}

.tc-status.green  { border: 2.5px solid var(--green); }
.tc-status.blue   { border: 2.5px solid var(--blue); }
.tc-status.red    { border: 2.5px solid var(--red); }

.tc-subtitle {
    font-size: 12px;
    color: var(--text-3);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tc-desc {
    font-size: 14px;
    color: var(--text-2);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Action buttons */
.tc-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.tc-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-1);
}

.tc-action-btn:hover { background: var(--bg); }

.btn-edit { color: var(--blue); }
.btn-archive { color: var(--text-2); }

/* Completed state */
.task-card.completed .tc-action-btn.btn-toggle {
    background: var(--black);
    border: 1px solid var(--black);
    color: #fff;
}

/* Delete button (hidden by default) */
.tc-delete {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-3);
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease;
}

.task-card:hover .tc-delete { opacity: 1; }
.tc-delete:hover { color: var(--red); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-3);
    font-size: 15px;
    font-weight: 500;
}

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal.active { display: flex; }

.modal-content {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-header {
    margin-bottom: 24px;
}

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

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: var(--bg);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
}

/* ================================================
   AUTH PAGES
   ================================================ */
.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    padding: 24px;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02), 0 20px 25px -5px rgba(0,0,0,0.04);
}

.auth-card h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-3);
    margin-bottom: 32px;
}

.auth-form-group {
    margin-bottom: 18px;
}

.auth-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-2);
    margin-bottom: 6px;
}

.auth-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-1);
    background: var(--bg);
    outline: none;
    transition: border-color .2s;
}

.auth-input:focus { border-color: var(--black); }
.auth-input::placeholder { color: var(--text-3); }

.confirm-btn {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    background: var(--black);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.confirm-btn:hover { background: #1e293b; }

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.google-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-1);
    cursor: pointer;
    transition: all .15s;
}

.composer-details input[type="date"],
.composer-details select,
.composer-details input[type="text"] {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-2);
    outline: none;
    cursor: pointer;
    transition: border-color .15s ease;
}

.composer-details input:focus,
.composer-details select:focus {
    border-color: var(--blue);
}

.google-btn:hover {
    background: var(--bg);
    border-color: var(--text-3);
}

.google-btn img {
    width: 18px;
    height: 18px;
}

.auth-links {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-3);
}

.auth-links a {
    color: var(--black);
    font-weight: 600;
    text-decoration: none;
}

.auth-links a:hover { text-decoration: underline; }

/* ================================================
   TOAST
   ================================================ */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

.toast {
    background: var(--black);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
    margin-top: 8px;
    transition: opacity .3s;
    animation: toastIn .3s ease;
}

.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.fade-out { opacity: 0; }

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

/* =========================================================
   SPA Page Routing & New Components
   ========================================================= */

/* Page Content Routing */
.page-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.page-content.active {
    display: block;
}

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

/* Empty State */
.empty-state {
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--text-secondary);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
    margin-top: var(--spacing-md);
}

/* Notes Area (Free Positioning) */
.notes-grid {
    position: relative;
    width: 100%;
    min-height: 600px; /* Allow space to move */
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 30px 30px; /* Grid pattern for visual guide */
    margin-top: var(--spacing-lg);
    border-radius: var(--radius);
    overflow: hidden;
}

.note-card {
    position: absolute; /* Changed from static/grid */
    width: 240px;
    background-color: #fffbc8; /* Default Yellow */
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: 2px 4px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    cursor: move; /* Indicate draggable */
    user-select: none;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    z-index: 1;
}

/* Color Variants */
.note-card.color-yellow { background-color: #fffbc8; border-color: #efe8a0; }
.note-card.color-blue   { background-color: #e1f5fe; border-color: #b3e5fc; }
.note-card.color-green  { background-color: #e8f5e9; border-color: #c8e6c9; }
.note-card.color-pink   { background-color: #fce4ec; border-color: #f8bbd0; }
.note-card.color-purple { background-color: #f3e5f5; border-color: #e1bee7; }
.note-card.color-orange { background-color: #fff3e0; border-color: #ffe0b2; }

/* Color Picker UI */
.color-selector {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
}

.color-option {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
}

.color-option:hover { transform: scale(1.2); }
.color-option.selected { border-color: var(--black); transform: scale(1.1); }

.opt-yellow { background-color: #fffbc8; }
.opt-blue   { background-color: #e1f5fe; }
.opt-green  { background-color: #e8f5e9; }
.opt-pink   { background-color: #fce4ec; }
.opt-purple { background-color: #f3e5f5; }
.opt-orange { background-color: #fff3e0; }

.note-content {
    color: #333;
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-wrap;
    flex-grow: 1;
}

.note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-md);
    font-size: 0.75rem;
    color: #777;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: var(--spacing-sm);
}

.note-delete-btn {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.note-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.note-edit-btn {
    background: none;
    border: none;
    color: var(--blue);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}

/* Profile Card */
.profile-card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-top: 20px;
}

.profile-card p {
    margin-bottom: 12px;
    font-size: 1.05rem;
    color: var(--text-1);
}

/* === DASHBOARD SPECIFIC STYLES === */
.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 24px;
}

.dashboard-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info .stat-label {
    font-size: 0.8rem;
    color: var(--text-2);
    display: block;
}

.stat-info .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-1);
}

/* Progress Bar */
.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--blue);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dashboard Grid & Widgets */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 24px;
}

.dashboard-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.widget-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.text-link-btn {
    background: none;
    border: none;
    color: var(--blue);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.widget-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Mini Items in Dashboard */
.dash-item {
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.dash-item:hover {
    border-color: var(--border);
    background: var(--surface);
}

.dash-item-info h4 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.dash-item-info p {
    font-size: 0.8rem;
    color: var(--text-2);
}

.dash-recent-note-card {
    background: #fffbc8; /* Sticky note yellow */
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
}

/* === PROJECTS PAGE === */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    border-color: var(--blue);
}

.project-card .project-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--blue);
}

.project-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.project-card .task-count {
    font-size: 0.8rem;
    color: var(--text-2);
}

.project-card .delete-project {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 1.2rem;
    cursor: pointer;
}

/* === BOOKMARKS PAGE === */
.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.bookmark-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s;
}

.bookmark-card:hover {
    border-color: var(--blue);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.bm-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bm-favicon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: contain;
}

.bm-title {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.bm-url {
    font-size: 0.75rem;
    color: var(--text-3);
    display: block;
    margin-top: 2px;
}

.bm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-chip {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--bg);
    color: var(--text-2);
    border: 1px solid var(--border);
}

.bm-actions {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bm-link {
    color: var(--blue);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.bm-delete {
    background: none;
    border: none;
    color: var(--red);
    font-size: 0.8rem;
    cursor: pointer;
}

.project-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    margin-bottom: 4px;
}





/* =========================================================
   RESPONSIVE DESIGN (Media Queries)
   ========================================================= */

/* --- DESKTOP VIEW (> 1024px) --- */
@media (min-width: 1025px) {
    #app-shell {
        grid-template-columns: 64px 260px 1fr;
    }
    
    #icon-rail, #sidebar {
        display: flex !important;
        transform: none !important;
        position: relative !important;
        left: auto !important;
        box-shadow: none !important;
    }

    #mobile-header, #mobile-nav-container, #sidebar-overlay {
        display: none !important;
    }
}

/* --- MOBILE & TABLET VIEW (< 1024px) --- */
@media (max-width: 1024px) {
    #app-shell {
        grid-template-columns: 1fr; /* Single column */
        height: 100vh;
        overflow: hidden;
    }

    /* Mobile Header */
    #mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        height: 60px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    #menu-toggle {
        background: none;
        border: none;
        color: var(--text-1);
        cursor: pointer;
        padding: 8px;
        margin-left: -8px;
    }

    .mobile-logo {
        font-weight: 700;
        font-size: 1.1rem;
        color: var(--text-1);
    }

    #mobile-user-avatar img {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        object-fit: cover;
    }

    /* Navigation Drawer (Icon Rail + Sidebar) */
    #icon-rail, #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 2001;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
        box-shadow: 20px 0 30px rgba(0,0,0,0.1);
    }

    #icon-rail {
        width: 64px;
        border-right: none;
        transform: translateX(-64px); 
    }

    #sidebar {
        left: 64px;
        width: 260px;
        border-left: 1px solid var(--border);
        transform: translateX(-324px); 
    }

    .nav-open #icon-rail { transform: translateX(0); }
    .nav-open #sidebar { transform: translateX(0); transition-delay: 0.05s; }

    /* Staggered Content Animation */
    .nav-open .nav-link,
    .nav-open .rail-icon:not(.rail-icon-fab) {
        animation: drawerItemIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    }

    .nav-open .rail-icon-group .rail-icon:nth-child(1) { animation-delay: 0.1s; }
    .nav-open .rail-icon-group .rail-icon:nth-child(2) { animation-delay: 0.12s; }
    .nav-open .rail-icon-group .rail-icon:nth-child(3) { animation-delay: 0.14s; }
    .nav-open .rail-icon-group .rail-icon:nth-child(4) { animation-delay: 0.16s; }
    .nav-open .rail-icon-group .rail-icon:nth-child(5) { animation-delay: 0.18s; }

    .nav-open .sidebar-nav .nav-link:nth-child(1) { animation-delay: 0.15s; }
    .nav-open .sidebar-nav .nav-link:nth-child(2) { animation-delay: 0.18s; }
    .nav-open .sidebar-nav .nav-link:nth-child(3) { animation-delay: 0.21s; }
    .nav-open .sidebar-nav .nav-link:nth-child(4) { animation-delay: 0.24s; }
    .nav-open .sidebar-nav .nav-link:nth-child(5) { animation-delay: 0.27s; }
    .nav-open .sidebar-nav .nav-link:nth-child(6) { animation-delay: 0.30s; }

    @keyframes drawerItemIn {
        from { opacity: 0; transform: translateX(-15px); }
        to { opacity: 1; transform: translateX(0); }
    }

    /* Sidebar Overlay */
    #sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        backdrop-filter: blur(4px);
        z-index: 2000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s ease;
    }

    .nav-open #sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    /* Main Area Adjustments */
    #main-area {
        padding: 24px 20px;
        height: calc(100vh - 60px); 
    }

    /* Composer Adjustments */
    .composer { padding: 12px 16px; }
    .composer-top { flex-direction: column; gap: 8px; }
    #add-btn, .composer-submit-btn { width: 100%; padding: 10px; }
    .composer-details { flex-wrap: wrap; gap: 8px; }
    .composer-details input, .composer-details select { flex: 1; min-width: 120px; }
    #memo-input { width: 100%; flex: none; }

    /* Dashboard & Cards */
    .dashboard-stats-row, .dashboard-grid { grid-template-columns: 1fr !important; }
    .stat-card, .task-card { padding: 16px; }
    .tc-title { font-size: 15px; }
    .tc-desc { font-size: 13px; margin-bottom: 16px; }
    .tc-action-btn { font-size: 12px; padding: 8px; }

    /* Note Grid */
    .notes-grid { display: flex; flex-wrap: wrap; gap: 16px; padding: 0; background: none; min-height: 400px; }
    .note-card { width: calc(50% - 10px); position: relative !important; left: auto !important; top: auto !important; margin-bottom: 16px; }

    /* =========================================================
       RADIAL FAB NAVIGATION
       ========================================================= */
    #mobile-nav-container {
        position: fixed;
        bottom: 24px;
        right: 24px;
        z-index: 5000;
        display: block !important;
    }

    .fab-main {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--black);
        color: #fff;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        cursor: pointer;
        transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        z-index: 5002;
        position: relative;
    }

    .fab-container.active .fab-main {
        transform: rotate(45deg);
        background: var(--red);
    }

    .fab-menu {
        position: absolute;
        bottom: 0;
        right: 0;
        width: 56px;
        height: 56px;
        z-index: 5001;
        pointer-events: none;
    }

    .fab-container.active .fab-menu {
        pointer-events: auto;
    }

    .fab-item {
        position: absolute;
        bottom: 6px;
        right: 6px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--surface);
        border: 1px solid var(--border);
        color: var(--text-1);
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        cursor: pointer;
        opacity: 0;
        transform: translate(0, 0) scale(0.5);
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        backdrop-filter: blur(8px);
    }

    /* Radial Arc Positioning */
    .fab-container.active .fab-item {
        opacity: 1;
        transform: translate(var(--x), var(--y)) scale(1);
    }

    /* Quarter Circle Arc (Bottom Right Corner) */
    .fab-item:nth-child(1) { --x: -0px;   --y: -130px; } /* Up */
    .fab-item:nth-child(2) { --x: -50px;  --y: -115px; transition-delay: 0.05s; }
    .fab-item:nth-child(3) { --x: -95px;  --y: -95px;  transition-delay: 0.1s; }
    .fab-item:nth-child(4) { --x: -115px; --y: -50px;  transition-delay: 0.15s; }
    .fab-item:nth-child(5) { --x: -130px; --y: -0px;   transition-delay: 0.2s; } /* Left */

    .fab-item:hover {
        background: var(--black);
        color: #fff;
        transform: translate(var(--x), var(--y)) scale(1.1) !important;
    }

    .fab-item.active {
        background: var(--blue);
        color: #fff;
        border-color: var(--blue);
    }
}
