/* MouseBucket - Main Stylesheet */

/* Reset and Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Dark theme inspired by MouseDash (default) */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-card: #1c2333;
    --border-color: #30363d;
    --text-color: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;

    --primary-color: #22d3ee;
    --primary-dark: #06b6d4;
    --success-color: #3fb950;
    --danger-color: #f85149;
    --warning-color: #f0b429;
    --accent-blue: #58a6ff;

    --bg-color: #0d1117;
    --card-bg: #1c2333;
    --shadow: 0 2px 8px rgba(0,0,0,0.4);
    --radius: 8px;

    /* Aliases for alternative naming convention */
    --color-bg-primary: #0d1117;
    --color-bg-secondary: #161b22;
    --color-bg-tertiary: #21262d;
    --color-bg-hover: #262c36;
    --color-border: #30363d;
    --color-text: #e6edf3;
    --color-text-primary: #e6edf3;
    --color-text-secondary: #8b949e;
    --color-primary: #22d3ee;
    --color-success: #3fb950;
    --color-danger: #f85149;
    --color-card-bg: #1c2333;
    --color-info: #58a6ff;
}

[data-theme="light"] {
    /* Light theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #eaeef2;
    --bg-card: #ffffff;
    --border-color: #d0d7de;
    --text-color: #24292f;
    --text-secondary: #57606a;
    --text-muted: #6e7781;

    --primary-color: #0969da;
    --primary-dark: #0550ae;
    --success-color: #1a7f37;
    --danger-color: #cf222e;
    --warning-color: #9a6700;
    --accent-blue: #0969da;

    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --radius: 8px;

    /* Aliases for alternative naming convention */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f6f8fa;
    --color-bg-tertiary: #eaeef2;
    --color-bg-hover: #e8ebed;
    --color-border: #d0d7de;
    --color-text: #24292f;
    --color-text-primary: #24292f;
    --color-text-secondary: #57606a;
    --color-primary: #0969da;
    --color-success: #1a7f37;
    --color-danger: #cf222e;
    --color-card-bg: #ffffff;
    --color-info: #0969da;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */
.main-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    font-size: 1.25rem;
    color: var(--text-color);
    text-decoration: none;
}

.logo img {
    height: 60px;
    width: auto;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-color);
    text-decoration: none;
}

.main-nav a.active {
    border-bottom-color: var(--primary-color);
}

.main-nav .badge {
    background: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    margin-left: 0.25rem;
}

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

.search-form {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.search-input-wrapper {
    position: relative;
}

.search-form input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    width: 200px;
    background: var(--bg-primary);
    color: var(--text-color);
}

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

.search-form button {
    padding: 0.5rem 1rem;
}

/* Header search dropdown */
.header-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 350px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.header-search-section {
    padding: 0.5rem 0;
}

.header-search-section:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.header-search-header {
    padding: 0.375rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-search-item {
    display: block;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
    color: var(--text-color);
    text-decoration: none;
}

.header-search-item:hover {
    background-color: var(--bg-tertiary);
}

.header-search-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
}

.header-search-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 8px;
    font-size: 0.625rem;
    margin-left: 0.375rem;
    font-weight: 500;
}

.header-search-badge.completed {
    background-color: rgba(63, 185, 80, 0.2);
    color: var(--success-color);
}

.header-search-badge.dynamic {
    background-color: rgba(88, 166, 255, 0.2);
    color: var(--accent-blue);
}

.header-search-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.header-search-all {
    display: block;
    padding: 0.625rem 0.75rem;
    text-align: center;
    color: var(--primary-color);
    font-size: 0.8125rem;
    font-weight: 500;
    border-top: 1px solid var(--border-color);
    text-decoration: none;
    background: var(--bg-tertiary);
}

.header-search-all:hover {
    background: var(--bg-color);
    text-decoration: underline;
}

.header-search-dropdown mark {
    background-color: var(--primary-color);
    color: var(--bg-primary);
    padding: 0 2px;
    border-radius: 2px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.username {
    font-weight: 500;
}

.logout-btn {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-color);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: block;
}

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

/* Hamburger Menu */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 200;
}

.hamburger-menu span {
    width: 100%;
    height: 3px;
    background: var(--text-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
}

.mobile-nav-overlay.active {
    display: block;
}

.main-nav.mobile-active {
    display: flex !important;
    position: fixed;
    top: 60px;
    right: 0;
    width: 280px;
    max-width: 80%;
    height: calc(100vh - 60px);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
    z-index: 160;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

.main-nav.mobile-active a {
    padding: 1rem 1.5rem;
    border-bottom: none;
    border-left: 3px solid transparent;
}

.main-nav.mobile-active a:hover,
.main-nav.mobile-active a.active {
    background: var(--bg-tertiary);
    border-left-color: var(--primary-color);
}

.main-nav.mobile-active .badge {
    margin-left: auto;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Footer */
.main-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-full {
    width: 100%;
    text-align: center;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

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

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.75rem;
}

.page-description {
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.back-link {
    display: block;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Page Layout */
.page-layout,
.dashboard-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
}

/* Sidebar */
.sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    height: fit-content;
    position: sticky;
    top: 76px;
}

.sidebar-section h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.sidebar-quick-action {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.bucketlist-nav {
    list-style: none;
    margin-bottom: 1rem;
}

.bucketlist-nav li a {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    color: var(--text-color);
    border-radius: var(--radius);
    margin-bottom: 0.25rem;
}

.bucketlist-nav li a:hover {
    background: var(--bg-color);
    text-decoration: none;
}

.bucketlist-nav li a.active {
    background: var(--primary-color);
    color: white;
}

.bucketlist-nav .count {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.bucketlist-nav li a.active .count {
    color: rgba(255,255,255,0.8);
}

.bucketlist-nav .empty {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

/* Dynamic list info in sidebar */
.sidebar .dynamic-list-info {
    font-size: 0.875rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar .dynamic-list-info p {
    margin: 0 0 0.5rem 0;
}

.sidebar .dynamic-list-info ul {
    list-style: none;
    margin: 0 0 0.75rem 0;
    padding: 0;
}

.sidebar .dynamic-list-info li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.sidebar .dynamic-list-info code {
    background: var(--bg-color);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.8125rem;
}

.sidebar .dynamic-list-info .tag.small {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
}

.sidebar .dynamic-list-info .help-text {
    font-size: 0.8125rem;
    margin: 0;
}

/* Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    text-align: center;
    transition: border-color 0.2s ease;
}

.stat-card:hover {
    border-color: var(--primary-color);
}

.stat-card.large {
    padding: 1.5rem;
}

.stat-card.highlight {
    background: var(--primary-color);
    color: var(--bg-primary);
    border-color: var(--primary-color);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.stat-card.highlight .stat-label {
    color: rgba(255,255,255,0.8);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.dashboard-card h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.entry-list-simple {
    list-style: none;
}

.entry-list-simple li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.entry-list-simple li:last-child {
    border-bottom: none;
}

.entry-list-simple li.completed a {
    text-decoration: line-through;
    color: var(--text-muted);
}

.entry-list-simple .meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.empty-message {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="search"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-color);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.form-row {
    display: flex;
    gap: 0.5rem;
}

.form-row select {
    flex: 1;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

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

.checkbox-label input {
    width: auto;
}

.help-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

/* Filter Bar */
.filter-bar {
    margin-bottom: 1rem;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: var(--radius);
}

.filter-tabs a {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    color: var(--text-secondary);
}

.filter-tabs a:hover {
    background: var(--bg-tertiary);
    text-decoration: none;
}

.filter-tabs a.active {
    background: var(--primary-color);
    color: white;
}

.filter-tabs .count {
    font-size: 0.8125rem;
    margin-left: 0.25rem;
}

/* Tag Filter Bar */
.tag-filter-bar {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

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

.tag-filter-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.tag-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.tag-filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.tag-filter-option input[type="checkbox"] {
    margin: 0;
}

.tag-filter-option .tag {
    transition: all 0.2s ease;
}

.tag-filter-option input[type="checkbox"]:checked + .tag {
    background: var(--primary-color);
    color: white;
}

/* Tab Bar */
.tab-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-bar a {
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab-bar a:hover {
    color: var(--text-color);
    text-decoration: none;
}

.tab-bar a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Bucket List Grid */
.bucketlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.bucketlist-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bucketlist-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.15);
}

.bucketlist-card h3 {
    margin-bottom: 0.5rem;
}

.bucketlist-card .description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.bucketlist-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.bucketlist-stats .open {
    color: var(--primary-color);
}

.bucketlist-stats .closed {
    color: var(--success-color);
}

.bucketlist-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.bucketlist-card .meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Entry List */
.entries-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.entries-list .entry-row:last-child {
    border-bottom: none;
}

.entry-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: border-color 0.2s ease;
}

.entry-card:hover {
    border-color: var(--primary-color);
}

.entry-card.checked {
    opacity: 0.7;
}

.entry-card.checked .entry-content h4 a {
    text-decoration: line-through;
    color: var(--text-muted);
}

.entry-checkbox-form {
    flex-shrink: 0;
}

.checkbox-btn {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--success-color);
}

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

.entry-content {
    flex: 1;
}

.entry-content h4 {
    margin-bottom: 0.25rem;
}

.entry-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.entry-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.entry-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Entry Row (single-line compact layout) */
.entry-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
    position: relative;
}

.entry-row:hover {
    background-color: var(--bg-tertiary);
}

.entry-row.checked {
    opacity: 0.6;
}

.entry-row.checked .entry-name a {
    text-decoration: line-through;
    color: var(--text-muted);
}

.entry-row-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.entry-row .entry-checkbox-form {
    flex-shrink: 0;
}

.entry-row .entry-name {
    flex-shrink: 0;
    font-weight: 500;
}

.entry-row .entry-name a {
    color: var(--text-color);
    text-decoration: none;
}

.entry-row .entry-name a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.entry-tags-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
}

.tag-small {
    font-size: 0.6875rem;
    padding: 0.125rem 0.375rem;
}

.entry-row-right {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: 1rem;
}

/* Entry row tooltip */
.entry-row.has-tooltip {
    position: relative;
}

.entry-row.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--bg-secondary);
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.875rem;
    line-height: 1.4;
    white-space: pre-wrap;
    max-width: 400px;
    width: max-content;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.entry-row.has-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Tooltip arrow */
.entry-row.has-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--border-color);
    z-index: 1001;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.entry-row.has-tooltip:hover::before {
    opacity: 1;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.tag-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    transition: border-color 0.2s ease;
}

.tag-card:hover {
    border-color: var(--primary-color);
}

.tag-card h3 {
    margin-bottom: 0.25rem;
}

.tag-count {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.tag-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.8125rem;
    color: var(--text-color);
}

.badge.admin {
    background: var(--primary-color);
    color: white;
}

.badge.user {
    background: #6c757d;
    color: white;
}

.badge.small {
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
}

.badge.dynamic {
    background: var(--accent-blue);
    color: white;
}

.bucketlist-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

/* Dynamic List Info */
.dynamic-list-info {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-blue);
    border-radius: var(--radius);
}

.dynamic-list-info ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.dynamic-list-info li {
    margin: 0.5rem 0;
}

.dynamic-list-info code {
    background: var(--bg-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.dynamic-criteria {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.criteria-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.tag.small {
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
}

/* Entry Detail */
.entry-detail {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.entry-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.entry-status.open {
    background: #fff3cd;
    color: #856404;
}

.entry-status.completed {
    background: #d4edda;
    color: #155724;
}

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

.entry-meta-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.entry-actions-panel h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    margin-bottom: 1rem;
}

.action-card h4 {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.action-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.action-card.danger {
    border: 1px solid var(--danger-color);
}

/* Suggestions */
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.suggestion-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.suggestion-card.accepted {
    border-left: 4px solid var(--success-color);
}

.suggestion-card.rejected {
    border-left: 4px solid var(--danger-color);
    opacity: 0.7;
}

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

.suggestion-header h3 {
    font-size: 1rem;
}

.status-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.status-badge.pending {
    background: var(--warning-color);
    color: #333;
}

.status-badge.accepted {
    background: var(--success-color);
    color: white;
}

.status-badge.rejected {
    background: var(--danger-color);
    color: white;
}

.status-badge.completed {
    background: var(--success-color);
    color: white;
}

.suggestion-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.suggested-tags {
    margin-bottom: 0.5rem;
}

.suggestion-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.suggestion-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.inline-form {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

.inline-form select {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-color);
}

/* Statistics */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stats-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.stats-section h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

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

.year-selector select {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-color);
}

.recent-activity-stats {
    display: flex;
    gap: 2rem;
}

.activity-stat {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.activity-stat .value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.activity-stat .label {
    color: var(--text-muted);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
}

td.number,
th.number {
    text-align: right;
}

td.actions {
    display: flex;
    gap: 0.5rem;
}

.completion-bar {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: linear-gradient(to right, var(--success-color) var(--rate), var(--bg-color) var(--rate));
    border-radius: var(--radius);
    font-size: 0.8125rem;
}

/* Search */
.search-form-full {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.search-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.search-row input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-color);
}

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

.search-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.filter-group select {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-color);
}

.search-results {
    margin-top: 1rem;
}

.results-count {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
}

.search-result-card.checked h3 a {
    color: var(--text-muted);
}

.search-result-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.result-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.result-description mark {
    background: #fff3cd;
    padding: 0 0.125rem;
}

.result-lists,
.result-tags {
    margin-bottom: 0.5rem;
}

.result-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Profile Page */
.profile-layout {
    display: grid;
    gap: 1.5rem;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-info .info-row:last-child {
    border-bottom: none;
}

.profile-info .label {
    font-weight: 500;
    color: var(--text-secondary);
}

.profile-info .value {
    color: var(--text-color);
}

.profile-form {
    margin-top: 1rem;
}

.username {
    cursor: pointer;
}

.username:hover {
    color: var(--primary-color);
}

/* Admin */
.admin-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
}

.admin-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    height: fit-content;
}

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

.admin-nav a {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text-color);
}

.admin-nav a:hover {
    background: var(--bg-color);
    text-decoration: none;
}

.admin-nav a.active {
    background: var(--primary-color);
    color: white;
}

.admin-content {
    min-width: 0;
}

.admin-stats {
    margin-bottom: 2rem;
}

.admin-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.admin-section h2 {
    margin-bottom: 1rem;
}

.quick-links {
    display: flex;
    gap: 0.75rem;
}

.users-table {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Login Page */
.login-page {
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 300px;
    height: auto;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--text-muted);
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 1rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 2;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
}

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

/* Entry List (simple) */
.entry-list {
    list-style: none;
}

.entry-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.entry-list li:last-child {
    border-bottom: none;
}

.entry-list li.checked a {
    text-decoration: line-through;
    color: var(--text-muted);
}

.entry-list .meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
    .page-layout,
    .dashboard-layout,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .admin-sidebar {
        position: static;
        order: 1;
    }

    .page-content,
    .dashboard-content,
    .admin-content {
        order: 0;
    }

    .main-nav {
        display: none;
    }

    .hamburger-menu {
        display: flex;
    }
}

@media (max-width: 600px) {
    .main-header {
        padding: 0 1rem;
    }

    .search-form {
        display: none;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bucketlists-grid,
    .tags-grid {
        grid-template-columns: 1fr;
    }

    .entry-card {
        flex-direction: column;
    }

    .entry-actions {
        margin-top: 0.75rem;
    }
}

/* ==========================================================================
   Bucket List Sharing Styles
   ========================================================================== */

/* Shared bucket list indicator in sidebar */
.bucketlist-nav .shared-icon {
    font-size: 0.9em;
    margin-right: 0.25rem;
    opacity: 0.7;
}

/* Shared badge */
.badge.shared {
    background: var(--color-info);
    color: white;
}

/* Shared bucket list card styling */
.bucketlist-card.shared {
    border-left: 3px solid var(--color-info);
}

.bucketlist-card .shared-by {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Shared info on bucket list page */
.shared-info {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-top: 0.5rem;
}

/* Share modal specific styles */
.modal-large {
    max-width: 600px;
}

.share-section {
    margin-bottom: 2rem;
}

.share-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.shared-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--color-bg-secondary);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.shared-user-item .username {
    font-weight: 500;
}

.user-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.empty-state {
    padding: 1rem;
    text-align: center;
    color: var(--color-text-secondary);
    font-style: italic;
}

/* Disabled checkbox for read-only lists */
.checkbox-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.checkbox-btn:disabled:hover {
    background-color: transparent;
}

/* === Attachments & Notes Sections === */

/* Entry Section (for both attachments and notes) */
.entry-section {
    background: var(--color-card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 50px;
}

.entry-section h3 {
    margin-bottom: 1rem;
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    visibility: visible !important;
}

.entry-section > * {
    display: block;
    visibility: visible !important;
}

.count-badge {
    background: var(--color-primary);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: normal;
}

/* File Upload Form */
.upload-form {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-input-wrapper input[type="file"] {
    display: none;
}

.file-name-display {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--color-bg-secondary);
    border-radius: 2px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: var(--color-primary);
    animation: progress 1s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Attachments List */
.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--color-bg-secondary);
    border-radius: 6px;
    transition: background 0.2s;
}

.attachment-item:hover {
    background: var(--color-bg-hover);
}

.attachment-icon {
    font-size: 1.5rem;
    min-width: 2rem;
    text-align: center;
}

.attachment-info {
    flex: 1;
    min-width: 0;
}

.attachment-name a {
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: 500;
}

.attachment-name a:hover {
    text-decoration: underline;
    color: var(--color-primary);
}

.attachment-meta {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-top: 0.25rem;
}

/* Attachment Indicator in Entry Row */
.attachment-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: var(--color-bg-secondary);
    border-radius: 12px;
    font-size: 0.85rem;
    margin-left: 0.5rem;
    white-space: nowrap;
}

/* Notes Section */
.note-form {
    margin-bottom: 1.5rem;
}

.note-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

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

.note-item {
    padding: 1rem;
    background: var(--color-bg-secondary);
    border-radius: 6px;
    border-left: 3px solid var(--color-primary);
}

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

.note-date {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.edited-badge {
    font-size: 0.75rem;
    font-style: italic;
    margin-left: 0.5rem;
    opacity: 0.7;
}

.note-content {
    color: var(--color-text-primary);
    line-height: 1.6;
}

/* Empty Message */
.empty-message {
    text-align: center;
    color: var(--color-text-secondary);
    padding: 2rem;
    font-style: italic;
}

/* Completion Date Inline Display */
.completion-date {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: var(--color-success);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-left: 0.5rem;
    white-space: nowrap;
}

/* === Entry Page Tabs === */

.entry-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-border);
    flex-wrap: wrap;
}

.entry-tab {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: -2px;
}

.entry-tab:hover {
    color: var(--color-primary);
    background: var(--color-bg-hover);
}

.entry-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-badge {
    background: var(--color-primary);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: bold;
}

.entry-tab-content {
    display: none;
}

.entry-tab-content.active {
    display: block;
}

/* Ensure all form elements are visible in active tabs */
.entry-tab-content.active form,
.entry-tab-content.active .form-group,
.entry-tab-content.active textarea,
.entry-tab-content.active button,
.entry-tab-content.active input {
    display: initial !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
}

.entry-tab-content.active button {
    display: inline-block !important;
}

.entry-tab-content.active textarea {
    display: block !important;
    width: 100% !important;
}

.entry-tab-content.active .form-group textarea {
    display: block !important;
    visibility: visible !important;
}

.entry-tab-content.active .btn {
    display: inline-block !important;
    visibility: visible !important;
}

/* === Gallery Grid === */

.gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
    visibility: visible !important;
    opacity: 1 !important;
}

.gallery-item {
    position: relative;
    background: var(--color-bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block !important;
    visibility: visible !important;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gallery-item a {
    display: block;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item-info {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.gallery-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item-meta {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.gallery-delete {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.gallery-item:hover .gallery-delete {
    opacity: 1;
}

/* Ensure note form is visible in Notes tab */
.note-form {
    display: block;
    visibility: visible;
}

.note-form .form-group {
    display: block;
    visibility: visible;
}

.note-form button[type="submit"] {
    display: inline-block;
    visibility: visible;
}

/* Force note form button to be visible */
#note-form button.btn-primary {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    margin-top: 0.5rem;
    background: var(--color-primary);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* === Image Lightbox === */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10000;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 0.7;
}

#lightbox-image {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    margin-top: 1rem;
    color: white;
    font-size: 1rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    max-width: 90vw;
    word-wrap: break-word;
}

.lightbox-download-btn {
    margin-top: 1rem;
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.2s;
}

.lightbox-download-btn:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.gallery-image-link {
    cursor: pointer;
}

.gallery-image-link:hover {
    text-decoration: none;
}

/* Prevent body scroll when lightbox is open */
body.lightbox-open {
    overflow: hidden;
}
