/* --- Kitchen Table Main Stylesheet --- */

/* @import rules MUST be at the very top of the file, on their own lines. */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;700;800&family=Kalam:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0');

:root {
    --primary-color: #ec4913;
    --font-display: "Plus Jakarta Sans", sans-serif;
    --font-handwritten: "Kalam", cursive;
    --background-light: #f8f6f6;
    --note-background: #fff2ab;
    --todolist-background: #fdfbf7;
    --todolist-lines: #d1e7f7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--background-light);
    font-family: var(--font-display);
    min-height: 100vh;
}

/* --- Main Layout --- */
.kitchen-table-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.table-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.1);
}

/* --- Thing Interaction & Layout --- */
.thing-wrapper {
    position: absolute;
    display: flex;
    flex-direction: column;
    width: 120px;
    cursor: grab;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.thing-wrapper:hover,
.thing-wrapper:focus-within {
    transform: scale(1.05) !important;
    z-index: 1000;
}
.is-dragging {
    cursor: grabbing !important;
    z-index: 2000 !important;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
    transform: scale(1.1) !important;
}
.thing-preview {
    width: 100%;
    height: 100px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    position: relative;
    transition: transform 0.2s ease-in-out, border-color 0.3s ease, opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    z-index: 10;
}
.thing-expanded-view {
    position: absolute;
    width: auto;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out, visibility 0.2s ease-in-out;
}
.thing-wrapper.is-expanded > .thing-expanded-view {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
    z-index: 20;
}
.thing-wrapper.is-expanded > .thing-preview,
.thing-wrapper.is-expanded > .thing-meta-tag,
.thing-wrapper.is-expanded > .thing-drag-handle {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}
.thing-meta-tag {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.25rem;
    font-size: 0.75rem;
    color: #fff;
    white-space: nowrap;
    opacity: 0.8;
    transition: opacity 0.2s ease-in-out;
    order: 1;
    margin-top: 5px;
    line-height: 1;
}
.thing-wrapper:hover .thing-meta-tag {
    opacity: 1;
}
.thing-meta-tag img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}
.thing-drag-handle {
    height: 10px;
    width: 100%;
    order: 2;
}

/* --- User Menu --- */
.user-menu-container {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
}
.user-avatar {
    position: relative;
    cursor: pointer;
}
.user-avatar > img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: block;
}
.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    width: 220px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}
.user-avatar:hover .user-dropdown,
.user-avatar:focus .user-dropdown,
.user-avatar:focus-within .user-dropdown {
    display: block;
}
.dropdown-header {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 0.5rem;
    color: #555;
    line-height: 1.3;
}
.user-dropdown a {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
}
.user-dropdown a:hover {
    background-color: #f5f5f5;
}

/* --- Buttons & Panels --- */
.add-thing-toggle-button,
.filter-toggle-button {
    position: fixed;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 1300;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
}
.add-thing-toggle-button {
    background-color: var(--primary-color);
    color: white;
    bottom: 1.5rem;
}
.add-thing-toggle-button::before,
.add-thing-toggle-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 3px;
    background-color: white;
    transform-origin: center;
    transition: transform 0.3s ease-in-out;
}
.add-thing-toggle-button::before { transform: translate(-50%, -50%) rotate(0deg); }
.add-thing-toggle-button::after { transform: translate(-50%, -50%) rotate(90deg); }
.add-thing-toggle-button.is-open { transform: rotate(135deg); background-color: #333; }
.filter-toggle-button {
    background-color: #333;
    color: white;
    bottom: 5.5rem;
}
.add-thing-toggle-button:hover,
.filter-toggle-button:hover { transform: scale(1.1); }
.add-thing-toggle-button.is-open:hover { transform: scale(1.1) rotate(135deg); }
.add-thing-panel {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}
.add-thing-panel.is-open {
    opacity: 1;
    pointer-events: auto;
}
.add-thing-creator-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 480px;
    width: 100%;
    padding: 1rem;
}
.thing-creator-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background-color: rgba(255,255,255,0.95);
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.thing-creator-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.thing-creator-button .material-symbols-outlined {
    font-size: 2.5rem;
    color: var(--primary-color);
}
/* --- Creator Panels --- */
.note-creator-panel, .photo-creator-panel, .video-creator-panel, .poll-creator-panel, .link-creator-panel, .snippet-creator-panel {
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 480px;
}
.note-creator-panel textarea {
    font-family: var(--font-handwritten);
    font-size: 1.5rem;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    padding: 0.75rem;
    height: 150px;
    resize: none;
    background-color: var(--note-background);
    min-width: 100%;
}
.poll-creator-panel .poll-options-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.snippet-creator-panel textarea {
    width: 100%;
    height: 200px;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    font-family: monospace;
    font-size: 0.9rem;
    resize: vertical;
}
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}
.form-actions button, .settings-item button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 0.25rem;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
}
.form-actions .back-to-grid-button {
    background-color: #6c757d;
}

/* --- Filter Panel --- */
.filter-panel {
    position: fixed;
    top: 5rem;
    right: 1.5rem;
    width: 280px;
    background: var(--background-light);
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 1.5rem;
    z-index: 1250;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(-20px);
}
.filter-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.filter-panel h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.25rem;
    font-weight: bold;
}
.filter-panel .form-group { margin-bottom: 1.25rem; }
.filter-panel label { font-weight: 500; display: block; margin-bottom: 0.5rem; }
.filter-panel select, .filter-panel button { width: 100%; padding: 0.5rem; border: 1px solid #ccc; border-radius: 0.25rem; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.checkbox-group label { display: flex; align-items: center; gap: 0.25rem; font-weight: normal; }
.filter-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; }
.filter-actions button { width: auto; padding: 0.5rem 1.5rem; }
.clear-filters-button { color: #555; text-decoration: underline; background: none; border: none; cursor: pointer; }

/* --- Component Specific Styles --- */

/* Note */
.note .thing-preview, .note .thing-expanded-view { background-color: var(--note-background); padding: 1rem; box-shadow: 5px 5px 15px rgba(0,0,0,0.25); color: #3a3532; min-height: 120px; width: 180px; }
.note .thing-preview { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100px; width: 100%; }
.note .thing-preview p, .note .thing-expanded-view p { margin: 0; font-size: 1.25rem; line-height: 1.4; font-family: var(--font-handwritten); }
.delete-note-form button { background: none; border: none; color: #8b5a2b; cursor: pointer; padding: 2px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.delete-note-form button:hover { color: var(--primary-color); background-color: rgba(0,0,0,0.1); }
.delete-note-form .material-symbols-outlined { font-size: 1.25rem; }
.note .thing-expanded-view .delete-note-form { position: absolute; bottom: 5px; right: 5px; }

/* To-Do List */
.todolist.thing-wrapper { padding-bottom: 0; height: auto; width: 140px; }
.todolist .thing-preview { background-color: var(--todolist-background); background-image: repeating-linear-gradient(to bottom, transparent, transparent 9px, var(--todolist-lines) 10px, var(--todolist-lines) 10px); padding: 1rem; border-radius: 0.25rem; text-align: center; color: #3a3532; height: auto; }
.todolist .thing-preview .material-symbols-outlined { font-size: 2.5rem; }
.todolist .thing-preview p { font-size: 1.1rem; font-weight: bold; margin: 0; }
.todolist .thing-expanded-view { width: 300px; }
.todolist-content { background-color: var(--todolist-background); background-image: repeating-linear-gradient(to bottom, transparent, transparent 26px, var(--todolist-lines) 27px, var(--todolist-lines) 27px); padding: 1.5rem; border-radius: 0.25rem; }
.todolist-content h2 { font-size: 1.75rem; font-weight: bold; color: #3a3532; border-bottom: 2px solid #e7d5cf; padding-bottom: 0.5rem; margin: 0 0 0.75rem 0; font-family: var(--font-handwritten); }
.todo-item-container { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.todo-item-container .todo-item { flex-grow: 1; display: flex; align-items: center; gap: 0.75rem; }
.todo-item p { font-size: 1.25rem; line-height: 27px; margin: 0; font-family: var(--font-handwritten); }
.delete-todo-form button { background: none; border: none; color: #aaa; cursor: pointer; padding: 0; flex-shrink: 0; line-height: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.delete-todo-form button .material-symbols-outlined { font-size: 1.25rem; }
.delete-todo-form button:hover { color: var(--primary-color); background-color: rgba(0,0,0,0.1); }
.checklist-input{ appearance: none; -webkit-appearance: none; height: 1.25rem; width: 1.25rem; border-radius: 0.125rem; border:2px solid #e7d5cf; background-color: transparent; flex-shrink:0; background-repeat: no-repeat; background-position: center; background-size: 100% 100%; }
.checklist-input:checked{ background-color:var(--primary-color); border-color:var(--primary-color); background-image:url('data:image/svg+xml,%3csvg viewBox=%270 0 16 16%27 fill=%27rgb(252,249,248)%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3cpath d=%27M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z%27/%3e%3c/svg%3e');}
.todo-save-button { margin-top: 1rem; font-size: 0.9rem; padding: 0.4rem 0.8rem; float: right; }
.add-todo-form { display: flex; gap: 0.5rem; margin-top: 1rem; }
.add-todo-form input { flex-grow: 1; border: 1px solid #e7d5cf; padding: 0.25rem 0.5rem; font-family: var(--font-handwritten); font-size: 1.1rem; }
.add-todo-form button { float: none; margin: 0; padding: 0.25rem 1rem; }
.todolist-pen{ position: absolute; width: 160px; bottom: -1rem; left: -3rem; transform: rotate(-25deg); pointer-events: none; filter: drop-shadow(5px 5px 5px rgba(0,0,0,0.4));}

/* Poll */
.poll.thing-wrapper { box-shadow: 0 8px 25px rgba(0,0,0,0.4); width: 140px; height: auto; }
.poll .thing-preview { display: flex; flex-direction: column; box-shadow: none; height: auto; }
.clipboard-top { background-color: #8b5a2b; padding: 0.25rem; border-radius: 0.5rem 0.5rem 0 0; border-bottom: 2px solid #5a3d1c; }
.clipboard-clip { width: 33.33%; height: 0.75rem; background-color: #d1d5db; margin: 0 auto; border-radius: 0.25rem 0.25rem 0 0; border-bottom: 2px solid #9ca3af;}
.clipboard-bottom { background-color: white; padding: 1rem 0.5rem; border-radius: 0 0 0.5rem 0.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; color: #1b110d; flex-grow: 1; }
.clipboard-bottom .material-symbols-outlined { font-size: 2.5rem; }
.clipboard-bottom p { font-size: 0.875rem; font-weight: bold; text-align: center; margin: 0; }
.poll .thing-expanded-view { width: 320px; display: flex; flex-direction: column; }
.clipboard-top.expanded { padding: 0.75rem; }
.clipboard-top.expanded .clipboard-clip { height: 1.5rem; border-bottom-width: 4px; }
.clipboard-bottom.expanded { padding: 2rem 1.5rem; }
.poll-question { font-size: 1.125rem; font-weight: bold; margin-bottom: 1rem; }
.poll-options-container { display: flex; flex-direction: column; gap: 0.75rem; width: 100%; }
.poll-option{display:flex;align-items:center;gap:1rem;border:1px solid #e7d5cf;padding:0.75rem;border-radius:0.25rem;}
.radiolist-input{appearance:none;-webkit-appearance:none;height:1.25rem;width:1.25rem;border:2px solid #e7d5cf;border-radius:9999px;background-color:transparent;flex-shrink:0;background-repeat:no-repeat;background-position:center;background-size:100% 100%;}
.radiolist-input:checked{border-color:var(--primary-color);background-image:url('data:image/svg+xml,%3csvg viewBox=%270 0 16 16%27 fill=%27rgb(236,73,19)%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3ccircle cx=%278%27 cy=%278%27 r=%273%27/%3e%3c/svg%3e');}

/* Video */
.video .thing-expanded-view { width: 580px; max-width: 95vw; height: auto; background: black; padding: 0; border: 4px solid white; }
.video-embed-container { position: relative; width: 100%; padding-top: 56.25%; }
.video-embed-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.video .play-button { background-color: rgba(0,0,0,0.6); border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.video .play-button .material-symbols-outlined { color: white; font-size: 24px; }
.video .thing-preview { background-size: cover; border-radius: 4px; }

/* Link */
.link { text-decoration: none; color: inherit; display: block; height: 100%; }
.thing-wrapper.link-wrapper { width: 280px; }
.link-wrapper .thing-preview { height: auto; }
.link .thing-preview { display: flex; flex-direction: column; background: white; border-radius: 0.5rem; overflow: hidden; height: auto; }
.link-image { width: 100%; height: 140px; background-size: cover; background-position: center; border-bottom: 1px solid #eee; }
.link-content { padding: 1rem; }
.link-title { font-weight: bold; margin: 0 0 0.25rem 0; font-size: 1rem; line-height: 1.3; }
.link-description { font-size: 0.875rem; color: #555; margin: 0 0 0.5rem 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-domain { font-size: 0.75rem; color: #999; }

/* Photos & Scroller */
.photos .thing-preview { border-radius: 0.25rem; background-color: white; padding: 0.25rem; }
.photo-grid-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 100%; height: 100%; }
.photo-grid-preview > div { background-size: cover; background-position: center; }
.photo-grid-preview .span-2 { grid-column: span 2; }
.photo-grid-overlay { position: absolute; inset: 0.25rem; background-color: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; color: white; font-weight: bold; }
.photos .thing-expanded-view { width: 400px; height: 300px; background-color: #222; border: 4px solid white; display: flex; justify-content: center; align-items: center; overflow: hidden; padding: 0; }
.photo-scroller-image { max-width: 100%; max-height: 100%; object-fit: contain; transition: opacity 0.2s ease-in-out; }
.photo-scroller-nav { position: absolute; top: 50%; transform: translateY(-50%); background-color: rgba(0,0,0,0.5); color: white; border: none; font-size: 2rem; font-weight: bold; cursor: pointer; height: 50px; width: 40px; line-height: 50px; text-align: center; opacity: 0; transition: opacity 0.2s ease; z-index: 10; }
.photos .thing-expanded-view:hover .photo-scroller-nav { opacity: 1; }
.photo-scroller-nav.prev { left: 10px; }
.photo-scroller-nav.next { right: 10px; }
.photo-scroller-gallery-link { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background-color: rgba(0,0,0,0.7); color: white; padding: 0.5rem 1rem; border-radius: 2rem; text-decoration: none; font-size: 0.8rem; font-weight: bold; opacity: 0; transition: opacity 0.2s ease; z-index: 10; }
.photos .thing-expanded-view:hover .photo-scroller-gallery-link { opacity: 1; }

/* Snippet */
.snippet .thing-preview { display: flex; flex-direction: column; align-items: center; justify-content: center; background-color: #2d2d2d; color: white; border-radius: 4px; text-align: center; }
.snippet .thing-preview .material-symbols-outlined { font-size: 2.5rem; }
.snippet .thing-preview p { font-weight: bold; font-size: 0.9rem; margin-top: 0.25rem; }
.snippet .thing-expanded-view { width: 400px; max-width: 95vw; height: auto; padding: 0; background-color: #2d2d2d; color: white; border-radius: 4px; overflow: hidden; }
.snippet-header { display: flex; justify-content: space-between; align-items: center; background-color: #444; padding: 0.25rem 0.75rem; font-size: 0.8rem; color: #ccc; gap: 1rem; }
.snippet-header .delete-note-form { position: static; padding: 0; }
.snippet-header .delete-note-form button { color: #ccc; }
.snippet-header .delete-note-form button:hover { color: var(--primary-color); background-color: rgba(255,255,255,0.1); }
.snippet-source { color: white; text-decoration: underline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snippet-content { margin: 0; max-height: 300px; overflow-y: auto; padding: 0.75rem; font-size: 0.85rem; text-align: left; }
.snippet-content code { white-space: pre-wrap; word-wrap: break-word; }
.snippet-copy-button { display: flex; align-items: center; justify-content: center; gap: 0.5rem; background-color: #444; color: white; border: none; width: 100%; padding: 0.5rem; cursor: pointer; font-family: var(--font-display); font-size: 0.9rem; }
.offscreen-clipboard-source { position: absolute; left: -9999px; }

/* Message of the Day (MOTD) */
.motd-container { position: absolute; top: 8%; right: 25%; width: 280px; padding: 1.5rem 1rem 1rem 1rem; background-color: var(--todolist-background); background-image: repeating-linear-gradient(to bottom, transparent, transparent 19px, #e0e0e0 20px, #e0e0e0 20px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); transform: rotate(2deg); z-index: 50; }
.motd-container p { font-family: var(--font-handwritten); font-size: 1.25rem; line-height: 20px; color: #333; margin: 0; }
.motd-container::before, .motd-container::after { content: ''; position: absolute; width: 100px; height: 30px; background-image: url('../images/tape.png'); background-size: contain; background-repeat: no-repeat; opacity: 0.7; }
.motd-container::before { top: -10px; left: -15px; transform: rotate(-15deg); }
.motd-container::after { top: -5px; right: -20px; transform: rotate(10deg); }

/* --- Settings & Admin Pages --- */
.settings-table-bg { padding: 0; margin: 0; background-size: cover; background-position: center; background-repeat: no-repeat; min-height: 100vh; }
.login-container { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 5000; }
.login-form { background: var(--background-light); padding: 2rem; border-radius: 0.5rem; box-shadow: 0 10px 30px rgba(0,0,0,0.2); width: 320px; text-align: center; }
.login-form h2 { font-family: var(--font-handwritten); font-size: 2.5rem; margin: 0 0 0.5rem 0; color: var(--primary-color); }
.settings-table-container { position: relative; width: 100%; min-height: 100vh; padding: 5rem 1rem 3rem 1rem; display: flex; flex-direction: column; align-items: center; gap: 2.5rem; }
.back-to-table-button { position: fixed; top: 1.5rem; left: 1.5rem; z-index: 1000; background-color: rgba(255,255,255,0.9); color: var(--primary-color); padding: 0.5rem 1rem; border-radius: 2rem; text-decoration: none; font-weight: bold; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.settings-item { position: relative; padding: 1.5rem; border-radius: 0.25rem; box-shadow: 0 8px 25px rgba(0,0,0,0.3); width: 95%; max-width: 600px; }
.settings-item:nth-of-type(odd) { transform: rotate(-1.5deg); }
.settings-item:nth-of-type(even) { transform: rotate(1.5deg); }
.settings-item.paper-item { background-color: #fdfdfd; }
.settings-item.clipboard-item { padding: 0; background: none; box-shadow: none; transform: none !important; }
.settings-item fieldset { border: none; padding: 0; margin: 0; }
.settings-item legend { font-weight: bold; font-size: 1.5rem; padding: 0; margin-bottom: 1rem; font-family: var(--font-handwritten); }
.settings-item details { margin-bottom: 1rem; border-bottom: 1px solid #eee; padding-bottom: 1rem; }
.settings-item summary { font-weight: bold; font-size: 1.1rem; cursor: pointer; }
.feedback-floater { position: fixed; top: 1.5rem; left: 50%; transform: translateX(-50%); width: auto; max-width: 500px; padding: 1rem; border-radius: 0.25rem; z-index: 2000; }
.feedback-floater.success { background-color: #dff0d8; color: #3c763d; }
.feedback-floater.error { background-color: #f2dede; color: #a94442; }
.admin-user-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.user-list-item { display: flex; align-items: center; gap: 1rem; background-color: #f9f9f9; padding: 0.75rem; border-radius: 0.25rem; border: 1px solid #eee; }
.user-list-item img { width: 40px; height: 40px; border-radius: 50%; }
.user-list-item .user-info { flex-grow: 1; line-height: 1.3; }
.form-row { display:flex; gap: 1rem; }
.form-row > input { flex:1; }

/* --- Creator & Filter Panel Overlays --- */
.filter-panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}
.filter-panel-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}
.filter-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    background: var(--background-light);
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 1.5rem;
    z-index: 1250;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translate(-50%, calc(-50% + 20px));
}
.filter-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%);
}

/* --- Form element enhancements --- */
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    font-weight: 500;
    display: block;
    margin-bottom: 0.5rem;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    font-size: 1rem;
}
.settings-item button,
.login-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 0.25rem;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    float: right;
}
.settings-item button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* --- Wallpaper Selector --- */
.wallpaper-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.wallpaper-option {
    position: relative;
    cursor: pointer;
}
.wallpaper-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.wallpaper-option img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 0.25rem;
    border: 3px solid transparent;
    transition: border-color 0.2s ease;
}
.wallpaper-option input[type="radio"]:checked + img {
    border-color: var(--primary-color);
}
.wallpaper-option span {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Custom Confirmation Modal */
.custom-confirm-overlay { position: fixed; inset: 0; background-color: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.custom-confirm-box { background-color: var(--background-light); padding: 1.5rem 2rem; border-radius: 0.5rem; box-shadow: 0 10px 30px rgba(0,0,0,0.3); text-align: center; width: 90%; max-width: 360px; }
.custom-confirm-box p { font-size: 1.1rem; margin: 0 0 1.5rem 0; color: #333; }
.custom-confirm-actions { display: flex; justify-content: center; gap: 1rem; }
.custom-confirm-actions button { float: none; margin: 0; font-size: 0.9rem; padding: 0.6rem 1.5rem; }
.custom-confirm-actions .button-secondary { background-color: #6c757d; color: white; }
.custom-confirm-actions .button-danger { background-color: #d9534f; color: white; }