:root {
    --bg-color: #1a1a1a;
    --surface-color: #2c2c2c;
    --primary-color: #4e8cff;
    --text-color: #f0f0f0;
    --border-color: #444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 1rem;
    cursor: auto;
}





.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--surface-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.control-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

button, input[type="text"], input[type="url"], select {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    background-color: #3a3a3a;
    color: var(--text-color);
    border-radius: 6px;
    font-size: 1rem;
}

button {
    background-color: var(--primary-color);
    border: none;
    font-weight: 500;
}

button:hover {
    opacity: 0.85;
}

#search-box {
    min-width: 250px;
}

#tag-filters-container {
    padding: 0 1rem 1rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-filter {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
}

.tag-filter.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

#dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
    position: relative; /* Add this for positioning context */
}

.dashboard-item {
    background-color: var(--surface-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.dashboard-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.dashboard-item.selected, .dashboard-item.active-iframe {
    box-shadow: 0 0 15px var(--primary-color);
    border: 1px solid var(--primary-color);
    transform: scale(1.05);
}

.add-item-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: 2px dashed var(--border-color);
    transition: background-color 0.2s ease, border-color 0.2s ease;
    min-height: 150px;
}

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

.add-item-card span {
    font-size: 4rem;
    font-weight: 200;
    color: var(--border-color);
    transition: color 0.2s ease;
}

.add-item-card:hover span {
    color: var(--primary-color);
}

.dashboard-item img {
    width: 48px;
    height: 48px;
    margin-bottom: 0.75rem;
}

.dashboard-item .item-name {
    font-weight: 600;
}

.item-tags {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    font-size: 0.75rem;
}

.item-tags .tag {
    background-color: #444;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.item-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 5px;
}

.item-actions button {
    padding: 2px; 
    font-size: 12px;
    background: rgba(0,0,0,0.4);
    border: none;
    border-radius: 4px;
    line-height: 1;
}

dialog {
    background-color: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    min-width: 400px;
}

dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

#edit-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#edit-form label {
    font-weight: 500;
}

#edit-form input, #edit-form select {
    width: 100%;
    box-sizing: border-box;
}

#edit-form small {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: -0.5rem;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}



/* --- Dock Bar Styles (The Missing Part) --- */

#dock-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    padding: 10px;
    background-color: rgba(44, 44, 44, 0.6); /* Use surface color with alpha */
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-radius: 18px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    z-index: 9998;
}

.dock-icon {
    position: relative; /* Crucial for positioning child action buttons */
    width: 50px;
    height: 50px;
    border-radius: 12px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.dock-icon:hover {
    transform: translateY(-10px) scale(1.1);
    background-color: rgba(255, 255, 255, 0.3);
}

.dock-icon.active {
    transform: translateY(-5px) scale(1.05);
    background-color: var(--primary-color);
}

.draggable-item.dragging {
    position: absolute;
    z-index: 1000;
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    pointer-events: none; /* Prevent the dragged item from interfering with drop targets */
}

.draggable-item.drop-target {
    border: 2px dashed var(--primary-color);
    background-color: rgba(78, 140, 255, 0.1);
}



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

.form-row input[type="checkbox"] {
    width: auto;
}

/* --- RSS Feed Styles --- */
#rss-feeds {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.rss-feed {
    background-color: var(--surface-color);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.rss-feed h2 {
    margin-top: 0;
}

.rss-content {
    max-height: 400px;
    overflow-y: auto;
}

.rss-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.rss-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.rss-item h3 a {
    color: var(--primary-color);
    text-decoration: none;
}

.rss-item p {
    font-size: 0.9rem;
    color: #ccc;
}

.rss-date {
    font-size: 0.8rem;
    color: #aaa;
}

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

.rss-feed-header .item-actions {
    position: static;
}

/* Styles for QR Code Subgroups */
.subgroup-container {
    grid-column: 1 / -1; /* Make subgroup span the full width of the grid */
    width: 100%;
    margin-bottom: 2rem;
}

.subgroup-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--primary-color);
}

.subgroup-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.qr-code-item {
    position: relative; /* This is needed for the action buttons */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background-color: var(--surface-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
    color: var(--text-color);
    width: 160px; /* Fixed width for consistency */
    height: 200px; /* Fixed height for consistency */
}

.qr-code-item .item-name {
    font-weight: bold;
    text-align: center;
}

.qr-code-canvas {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    background: #fff;
    border-radius: 6px;
}

/* Force red cursor on ALL elements and states */
* {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0L20 12L8 14L0 0Z" fill="red" stroke="black" stroke-width="1"/></svg>') 0 0, auto !important;
}

/* --- Calendar Styles --- */
#calendar-container {
    padding: 1.5rem;
    background-color: var(--surface-color);
    border-radius: 12px;
    margin: 2rem auto; /* Centered with more vertical margin */
    max-width: 900px; /* Constrain the width */
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

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

.calendar-header h2 {
    margin: 0;
    font-size: 1.8rem;
}

.calendar-header button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.8rem;
    padding: 0.5rem 1rem;
}

.import-notes-btn,
.export-notes-btn {
    font-size: 1rem !important;
    font-weight: 500;
    background-color: var(--primary-color) !important;
    border-radius: 6px;
    padding: 0.5rem 1rem !important;
    margin-left: 1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day-name {
    text-align: center;
    font-weight: bold;
    color: #aaa;
    padding-bottom: 0.5rem;
    font-size: 0.9rem;
}

.calendar-day {
    position: relative;
    background-color: #3a3a3a;
    border-radius: 8px;
    padding-top: 100%; /* Aspect ratio 1:1 */
    transition: all 0.2s ease;
    cursor: pointer !important;
    border: 2px solid transparent;
}

.calendar-day.other-month {
    opacity: 0.25;
    pointer-events: none;
}

.calendar-day .day-number {
    position: absolute;
    top: 8px;
    left: 10px;
    font-size: 1.4rem; /* Made number even bigger */
    font-weight: 500;
}

.calendar-day.has-note::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ffc107;
    box-shadow: 0 0 5px #ffc107;
}

.calendar-day:not(.other-month):hover {
    border-color: var(--primary-color);
    transform: scale(1.05); /* Add a little zoom on hover */
}

.calendar-day.today {
    /* Today is now primarily indicated by the number color and border */
    background-color: var(--surface-color); /* More subtle background */
    border: 2px solid var(--primary-color);
}

.calendar-day.today .day-number {
    font-weight: 700;
    color: var(--primary-color); /* Highlight the number directly */
}

#note-modal {
    background-color: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    min-width: 500px;
    max-width: 90vw;
}

/* --- Month Picker Styles --- */
.month-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns for months */
    gap: 1rem;
}

.month-picker-month {
    padding: 1.5rem 1rem;
    text-align: center;
    background-color: #3a3a3a;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.month-picker-month:hover {
    background-color: #4a4a4a;
    transform: scale(1.05);
}

.month-picker-month.current {
    background-color: rgba(78, 140, 255, 0.2);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

#note-modal::backdrop {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

#note-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#note-content {
    width: 100%;
    min-height: 200px;
    background-color: #3a3a3a;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
}

.note-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}
