.dialogue-page-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.dialogue-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.dialogue-header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.page-subtitle {
    margin: 0 0 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.dialogue-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .dialogue-page-wrapper {
        padding: 20px 16px 40px;
    }

    .dialogue-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dialogue-header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }

    .dialogue-header-actions .button {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(50% - 4px);
        font-size: 13px;
        padding: 10px 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .page-title {
        font-size: 24px;
    }

    .dialogue-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .dialogue-header-actions {
        flex-direction: column;
    }

    .dialogue-header-actions .button {
        width: 100%;
        max-width: 100%;
        font-size: 12px;
        padding: 10px;
    }
}

.stat-card {
    padding: 16px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.stat-card--success {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.4);
}

.stat-card--muted {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.5);
}

.stat-label {
    margin: 0;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.stat-value {
    margin: 8px 0 0;
    font-size: 28px;
    font-weight: 700;
}

.dialogue-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

.dialogue-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
    color: var(--text-secondary);
    font-size: 14px;
}

.dialogue-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 24px;
}

@media (max-width: 992px) {
    .dialogue-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dialogue-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .dialogue-filter-group {
        min-width: 100%;
    }

    .dialogue-layout {
        gap: 16px;
    }

    .dialogue-list-panel,
    .dialogue-form-panel {
        padding: 16px;
    }
}

.dialogue-list-panel,
.dialogue-form-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.dialogue-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dialogue-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    background: rgba(15, 23, 42, 0.4);
}

.dialogue-card__header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.dialogue-card__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.dialogue-card__meta {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.dialogue-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .dialogue-card {
        padding: 12px;
    }

    .dialogue-card__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .dialogue-card__title {
        font-size: 16px;
    }

    .dialogue-actions {
        width: 100%;
        justify-content: flex-start;
        margin-top: 8px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .dialogue-actions .button-small {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(50% - 3px);
        font-size: 11px;
        padding: 6px 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .dialogue-card__body p {
        font-size: 13px;
    }
}

.button-small {
    padding: 6px 10px;
    font-size: 12px;
    min-width: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.dialogue-card__body p {
    margin: 4px 0;
    font-size: 14px;
}

.dialogue-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.dialogue-badge--collect {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
}

.dialogue-badge--chat {
    background: rgba(147, 51, 234, 0.15);
    color: #c084fc;
}

.dialogue-badge--auto {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.dialogue-tag {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    font-size: 12px;
    margin-right: 6px;
    margin-top: 4px;
}

.dialogue-tag--empty {
    opacity: 0.6;
}

.dialogue-form-header {
    margin-bottom: 16px;
}

.dialogue-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dialogue-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-field {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.dialogue-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
}

.caption-name {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 6px;
    text-align: center;
}

.caption-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.caption-meta span {
    background: rgba(255, 255, 255, 0.03);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

/* ===== RESET & BASE ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #6366f1;
    --primary-hover: #818cf8;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --secondary-hover: #f472b6;
    --accent-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-dark: #0a0e27;
    --bg-darker: #050816;
    --bg-card: rgba(30, 41, 59, 0.8);
    --bg-card-hover: rgba(51, 65, 85, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: rgba(148, 163, 184, 0.2);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
}

/* Light Theme */
[data-theme="light"] {
    --bg-dark: #f8fafc;
    --bg-darker: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(241, 245, 249, 0.95);
    --bg-glass: rgba(0, 0, 0, 0.05);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: rgba(148, 163, 184, 0.3);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);
}

/* Noel Theme */
[data-theme="noel"] {
    --primary-color: #dc2626;
    --primary-hover: #ef4444;
    --primary-dark: #b91c1c;
    --secondary-color: #16a34a;
    --secondary-hover: #22c55e;
    --accent-color: #fbbf24;
    --danger-color: #dc2626;
    --warning-color: #f59e0b;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-card: rgba(30, 58, 30, 0.85);
    --bg-card-hover: rgba(40, 70, 40, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.08);
    --text-primary: #fef2f2;
    --text-secondary: #fecaca;
    --text-muted: #fca5a5;
    --border-color: rgba(220, 38, 38, 0.3);
    --shadow-sm: 0 2px 4px rgba(220, 38, 38, 0.2);
    --shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.3), 0 2px 4px -1px rgba(34, 197, 94, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(220, 38, 38, 0.4), 0 4px 6px -2px rgba(34, 197, 94, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(220, 38, 38, 0.5), 0 10px 10px -5px rgba(34, 197, 94, 0.3);
    --shadow-glow: 0 0 30px rgba(220, 38, 38, 0.4), 0 0 15px rgba(34, 197, 94, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0e27 0%, #1e293b 50%, #0f172a 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s ease, color 0.3s ease;
    padding-bottom: 0;
    overflow-x: hidden;
}

[data-theme="light"] body {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
}

[data-theme="noel"] body {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a1e 30%, #0f172a 60%, #3a1e1e 100%);
    background-size: 200% 200%;
    animation: noelGradient 15s ease infinite;
}

@keyframes noelGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Noel Theme Special Effects */
[data-theme="noel"] .button:hover {
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.5), 0 0 10px rgba(34, 197, 94, 0.3);
}

[data-theme="noel"] .filter-btn.current,
[data-theme="noel"] .date-btn.current {
    background: linear-gradient(135deg, #dc2626, #16a34a);
    box-shadow: 0 0 25px rgba(220, 38, 38, 0.6), 0 0 15px rgba(34, 197, 94, 0.4);
}

[data-theme="noel"] #pageTitle {
    background: linear-gradient(135deg, #dc2626 0%, #16a34a 50%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(220, 38, 38, 0.5);
}

/* ===== LAYOUT ===== */
#app {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== HEADER & TITLE ===== */
#pageTitle {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin: 30px 0 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 50%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    position: relative;
    padding-bottom: 20px;
}

#pageTitle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    border-radius: 2px;
}

#pageTitle span {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== NAVBAR ===== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    margin-bottom: 30px;
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 10;
}

.navbar-brand {
    flex: 1;
}

.navbar-brand #pageTitle {
    margin: 0;
    padding: 0;
    font-size: 1.8rem;
}

.navbar-brand #pageTitle::after {
    display: none;
}

.navbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
}

.nav-btn {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    box-shadow: var(--shadow-sm);
}


.nav-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

#checkBonusBtnMain {
    background: linear-gradient(135deg, var(--warning-color), var(--accent-color));
    color: #1e1e2f;
    font-weight: 700;
    border: none;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

#checkBonusBtnMain:hover {
    background: linear-gradient(135deg, var(--accent-color), var(--warning-color));
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
}

.nav-btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: var(--primary-color);
    color: white;
}

.nav-btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.contact-link {
    text-decoration: none;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-weight: 600;
}

.contact-link:hover {
    background: linear-gradient(135deg, #059669, #10b981);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    min-width: 200px;
    z-index: 2000;
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-dropdown:hover .dropdown-content,
.nav-dropdown.active .dropdown-content {
    display: block;
}

.dropdown-divider {
    height: 1px;
    margin: 8px 0;
    background: var(--border-color);
    border: none;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--bg-card-hover);
    color: var(--primary-color);
    padding-left: 20px;
}

/* Dropdown item with select */
.dropdown-item-select {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-item-select:hover {
    background: var(--bg-card);
    padding-left: 16px;
}

.dropdown-item-select .view-control-select {
    width: 100%;
    padding: 6px 12px;
    font-size: 14px;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item-select .view-control-select:hover {
    border-color: var(--primary-color);
}

.dropdown-item-select .view-control-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ===== FILTERS SECTION ===== */
.filters-section {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin: 16px auto;
    padding: 16px 20px;
    max-width: 1100px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    flex: 0 0 auto;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0;
    text-align: center;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* View Controls */
.view-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 20px auto;
    padding: 16px 24px;
    max-width: 1200px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.view-control-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.view-control-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-control-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.view-control-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.view-control-btn.danger {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.view-control-btn.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.view-control-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 4px;
}

.view-control-select {
    padding: 6px 12px;
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-control-select:hover {
    border-color: var(--primary-color);
}

.view-control-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.selected-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    padding: 6px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

/* Image Grid with dynamic columns - Base styles */
.image-grid {
    display: grid;
    list-style: none;
    margin: 20px 0;
    padding: 0;
    gap: 12px;
    /* Smaller gap for better space utilization */
}

.image-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.image-grid.columns-1 {
    grid-template-columns: repeat(1, 1fr);
    gap: 12px;
}

.image-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.image-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.image-grid.columns-5 {
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.image-grid.columns-6 {
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

/* List View */
.image-grid.list-view {
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 20px 0;
}

.image-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.image-grid.list-view li {
    width: 100%;
}

.image-grid.list-view li.list-item {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 20px;
    padding: 16px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.image-grid.list-view li.list-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.image-grid.list-view .list-item-image {
    position: relative;
    flex-shrink: 0;
    flex-basis: 280px;
    max-width: 340px;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.image-grid.list-view .list-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-grid.list-view .video-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.image-grid.list-view .list-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.image-grid.list-view .list-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.image-grid.list-view .list-item-name {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-grid.list-view .favorite-badge {
    font-size: 20px;
    flex-shrink: 0;
}

.favorite-badge {
    font-size: 18px;
    color: var(--primary-color);
}

.image-grid.list-view .list-item-details {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 8px 0;
}

.image-grid.list-view .detail-item {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.image-grid.list-view .detail-item strong {
    color: var(--primary-color);
    font-weight: 600;
    min-width: 60px;
}

.image-grid.list-view .list-item-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-muted);
}

.image-grid.list-view .list-item-date {
    flex: 1;
}

.image-grid.list-view .list-item-group {
    padding: 4px 12px;
    background: var(--bg-dark);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

/* Image selection checkbox */
.image-grid li {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.image-grid.list-view li.list-item {
    background: var(--bg-card);
}

.image-grid li .image-checkbox {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.image-grid li.selected {
    outline: 3px solid var(--primary-color);
    outline-offset: -3px;
    border-radius: var(--radius-sm);
}

/* Shortcuts Modal */
.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin: 8px 0;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.shortcut-item kbd {
    padding: 4px 8px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.shortcut-item span {
    color: var(--text-secondary);
    font-size: 14px;
}

.filter-btn {
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 600;
    min-width: 64px;
    border-radius: 28px;
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-primary);
    box-shadow: 0 6px 12px rgba(2, 6, 23, 0.45);
}

.date-btn {
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 600;
    min-width: 64px;
    border-radius: 28px;
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-primary);
    box-shadow: 0 6px 12px rgba(2, 6, 23, 0.45);
}

.filter-btn.current,
.date-btn.current {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(-2px);
}

.filter-btn:not(.current),
.date-btn:not(.current) {
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.filter-btn:not(.current):hover,
.date-btn:not(.current):hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-color);
    transform: translateY(-2px) scale(1.02);
}

#filters,
#dateFilters,
#controls {
    display: none;
    /* Hide old structure */
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 8, 22, 0.92);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.loading-spinner {
    text-align: center;
    color: var(--text-primary);
    padding: 40px;
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    min-width: 280px;
}

.spinner-ring {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    position: relative;
}

.spinner-ring-inner {
    width: 100%;
    height: 100%;
    border: 5px solid transparent;
    border-top: 5px solid var(--primary-color);
    border-right: 5px solid var(--secondary-color);
    border-radius: 50%;
    animation: spinRing 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    position: relative;
}

.spinner-ring-inner::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spinRing 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite reverse;
}

@keyframes spinRing {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: 0.5px;
    animation: pulseText 2s ease-in-out infinite;
}

@keyframes pulseText {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ===== NOTIFICATION TOAST ===== */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    min-width: 320px;
    max-width: 500px;
    display: none;
    /* Hidden by default */
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        transform: translateX(calc(100% + 40px));
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(calc(100% + 40px));
        opacity: 0;
    }
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(99, 102, 241, 0.2);
    border-left: 5px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.toast-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.toast-content.success {
    border-left-color: var(--accent-color);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(16, 185, 129, 0.2);
}

.toast-content.success::before {
    background: linear-gradient(180deg, var(--accent-color), #059669);
}

.toast-content.error {
    border-left-color: var(--danger-color);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(239, 68, 68, 0.2);
}

.toast-content.error::before {
    background: linear-gradient(180deg, var(--danger-color), #dc2626);
}

.toast-content.warning {
    border-left-color: var(--warning-color);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(245, 158, 11, 0.2);
}

.toast-content.warning::before {
    background: linear-gradient(180deg, var(--warning-color), #d97706);
}

.toast-icon {
    font-size: 26px;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 2px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-weight: 500;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    line-height: 1;
    margin-top: -2px;
}

.toast-close:hover {
    background: var(--bg-dark);
    color: var(--text-primary);
    transform: scale(1.1);
}

/* ===== INPUT PROMPT MODAL ===== */
.input-prompt-field {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    margin-bottom: 8px;
}

.input-prompt-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: var(--bg-card);
}

.input-prompt-field::placeholder {
    color: var(--text-muted);
}

/* Responsive Navbar */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }

    .navbar-brand #pageTitle {
        font-size: 1.5rem;
    }

    .navbar-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        /* Đảm bảo button wrap đều và căn giữa khi xuống dòng */
        align-content: center;
        align-items: center;
    }

    .nav-btn {
        min-width: 40px;
        padding: 8px 12px;
        font-size: 16px;
        flex: 0 0 auto;
        /* Đảm bảo button không bị shrink quá mức */
        flex-basis: auto;
    }

    /* Language and Theme buttons - now in dropdown, no special styling needed */

    /* Admin button - only visible when logged in */
    #adminBtn {
        flex-shrink: 0;
        position: relative;
    }

    .nav-dropdown {
        flex-shrink: 0;
    }

    /* Điều chỉnh để button wrap đều hơn trên mobile */
    @media (max-width: 480px) {
        .navbar-actions {
            gap: 6px;
            justify-content: center;
            align-content: center;
            align-items: center;
        }

        .nav-btn {
            min-width: 38px;
            padding: 6px 10px;
            font-size: 14px;
            flex: 0 0 auto;
        }

        /* Responsive dropdown trên mobile */
        .dropdown-content {
            right: auto;
            left: 0;
            min-width: 180px;
            max-width: calc(100vw - 20px);
        }
    }

    .filters-section {
        flex-direction: column;
        gap: 24px;
        padding: 20px;
        margin: 16px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-buttons {
        justify-content: center;
        width: 100%;
        gap: 8px;
    }

    .filter-btn,
    .date-btn {
        flex: 0 1 auto;
        min-width: 50px;
        max-width: 100%;
    }

    .notification-toast {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
}

#inputDiv {
    display: flex;
    gap: 12px;
    align-items: center;
}

#passwordInput {
    padding: 12px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#passwordInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: rgba(15, 23, 42, 0.8);
}

#passwordInput::placeholder {
    color: var(--text-muted);
}

/* ===== BUTTONS ===== */
.button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 14px 28px;
    cursor: pointer;
    margin: 0;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.button:hover::before {
    width: 400px;
    height: 400px;
}

.button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
}

.button:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.button.current {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-hover));
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.3), var(--shadow-lg);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.3), var(--shadow-lg);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(236, 72, 153, 0.2), var(--shadow-lg);
    }
}

/* Admin-only elements - hidden by default */
.ad {
    display: none !important;
}

/* Settings dropdown should always be visible (not hidden by .ad) */
#settingsDropdown {
    display: inline-block !important;
}

/* Language and Theme buttons are now in dropdown, no special styling needed */

/* Admin button should be hidden by default (shown when logged in) */
#adminBtn.ad {
    display: none !important;
}

/* Admin items in dropdown should be hidden by default */
#settingsDropdownContent .dropdown-item.ad {
    display: none !important;
}

/* Modal with .ad class should still be visible when displayed */
.modal.ad[style*="display: block"],
.modal.ad[style*="display:block"] {
    display: block !important;
}

.button.ad {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.button.ad:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(139, 92, 246, 0.4);
}

/* Modal scrollable content */
.modal-scrollable-content {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
}

/* Loading placeholder */
.loading-placeholder {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}


/* Grid controls - hidden by default */
#gridControls {
    display: none;
}

/* Bulk actions - hidden by default */
#bulkActions {
    display: none;
}

/* Admin modal actions */
.admin-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

/* Settings modal actions */
.settings-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
}

/* Input prompt modal */
.input-prompt-modal {
    max-width: 450px;
}

.input-prompt-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

/* Statistics modal */
.statistics-modal {
    max-width: 800px;
}

/* Shortcuts modal */
.shortcuts-modal {
    max-width: 600px;
}

.shortcuts-list {
    padding: 20px;
}

/* ===== TOOLTIPS ===== */
[title] {
    position: relative;
}

.nav-btn[title]:hover::after,
.button[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
}

.image-grid li[title]:hover::after,
.image-grid img[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    max-width: 250px;
    white-space: normal;
    word-wrap: break-word;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Image loading error handling */
.image-grid img {
    transition: opacity 0.3s ease;
}

.image-grid img[loading="lazy"] {
    opacity: 0;
    animation: imageFadeIn 0.3s ease forwards;
}

@keyframes imageFadeIn {
    to {
        opacity: 1;
    }
}

/* ===== IMAGE GRID ===== */
/* Default grid columns - will be overridden by column classes */
.image-grid:not(.list-view):not([class*="columns-"]) {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 0;
    margin: 20px auto;
    max-width: 1400px;
}

.image-grid li {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    cursor: pointer;
    border: 1px solid var(--border-color);
    margin: 0;
}

.image-grid li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.image-grid li:hover::before {
    opacity: 1;
}

.image-grid li:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    border-color: rgba(99, 102, 241, 0.5);
}

.image-grid img {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: contain;
    display: block;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: blur(3rem);
    background: linear-gradient(135deg, var(--bg-card), var(--bg-card-hover));
}

.image-grid img.unblurred {
    filter: none;
}

.image-grid li:hover img {
    transform: scale(1.03);
    filter: brightness(1.05);
}

.image-grid li.favorite {
    border: 3px solid var(--secondary-color);
    box-shadow: 0 0 30px rgba(236, 72, 153, 0.5), var(--shadow-lg);
    animation: favoriteGlow 3s ease-in-out infinite;
}

@keyframes favoriteGlow {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(236, 72, 153, 0.5), var(--shadow-lg);
    }

    50% {
        box-shadow: 0 0 40px rgba(236, 72, 153, 0.7), var(--shadow-lg);
    }
}

.image-grid li.favorite::before {
    content: '⭐';
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 28px;
    z-index: 10;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2) rotate(10deg);
    }
}

.image-caption {
    padding: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
    background: linear-gradient(to bottom, transparent, rgba(30, 41, 59, 0.95));
    position: relative;
    z-index: 2;
    margin-top: auto;
}

/* ===== PAGINATION ===== */
#pagination,
#paginationBottom {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 10px 0;
    padding: 10px 0;
}

.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 0;
    margin: 10px 0;
    flex-wrap: wrap;
}

.pagination-info {
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.pagination-button {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 14px 24px;
    margin: 0;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-button:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.pagination-button.disabled,
.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-button.current {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3), var(--shadow-lg);
    color: white;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: rgba(5, 8, 22, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    margin: 40px auto;
    max-width: 90%;
    max-height: 90vh;
    background: var(--bg-card);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(50px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    position: relative;
    text-align: center;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 16px;
    padding-right: 50px;
    /* Space for close button */
    border-bottom: 2px solid var(--border-color);
}

.close,
.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    color: var(--text-secondary);
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    z-index: 10;
    line-height: 1;
    padding: 0;
    margin: 0;
}

.close:hover,
.modal-close:hover {
    color: white;
    background: var(--danger-color);
    border-color: var(--danger-color);
    transform: rotate(90deg) scale(1.1);
    box-shadow: var(--shadow-lg);
}

.close:active,
.modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

.modal img,
.modal video {
    max-width: 100%;
    max-height: 70vh;
    height: auto;
    margin: 24px auto;
    display: block;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.profile-details {
    margin-top: 24px;
    padding: 24px;
    background: var(--bg-dark);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    text-align: left;
    clear: both;
    overflow: hidden;
}

.profile-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.profile-buttons .button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.profile-buttons .button-group h3 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-buttons .button {
    flex: 0 1 auto;
    min-width: 100px;
    padding: 8px 12px;
    font-size: 13px;
    text-align: center;
}

.profile-buttons .exit-button {
    background: linear-gradient(135deg, #b30000, #8b0000);
    margin-bottom: 10px;
}

.profile-buttons .exit-button:hover {
    background: linear-gradient(135deg, #8b0000, #b30000);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.profile-buttons .primary-button {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.profile-buttons .primary-button:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
}

.profile-buttons .delete-button {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
}

.profile-buttons .delete-button:hover {
    background: linear-gradient(135deg, #dc2626, var(--danger-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.profile-buttons .danger-button {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.profile-buttons .danger-button:hover {
    background: linear-gradient(135deg, #b91c1c, #dc2626);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.profile-buttons .info-button {
    background: linear-gradient(135deg, var(--accent-color), #059669);
}

.profile-buttons .info-button:hover {
    background: linear-gradient(135deg, #059669, var(--accent-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-info p {
    margin: 0;
    padding: 4px 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
}

.profile-info strong {
    color: var(--primary-color);
    margin-right: 8px;
    font-weight: 600;
    min-width: 120px;
    display: inline-block;
}

/* ===== FLOATING BUTTONS ===== */
.floating-button {
    position: fixed;
    bottom: 32px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.floating-button.left {
    left: 32px;
}

.floating-button.right {
    right: 32px;
}

.floating-button .button {
    width: 56px;
    height: 56px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 24px;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-button .button:hover {
    transform: scale(1.15) translateY(-4px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

#favoriteListContent .favorite-card,
#favoritePopupContent .favorite-card,
#bannedPopupContent .banned-card {
    width: 100%;
}

.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.card-actions .button {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .card-actions {
        justify-content: flex-start;
    }

    .card-actions .button {
        flex: 1 1 calc(50% - 8px);
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .card-actions .button {
        flex: 1 1 100%;
        width: 100%;
    }
}

#exitProfileBtn {
    width: auto;
    height: auto;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    min-width: 180px;
}

/* ===== LOADING STATE ===== */
#imageGrid:empty::before {
    content: '🖼️ Đang tải hình ảnh...';
    display: block;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
    font-size: 20px;
    font-weight: 600;
    animation: pulse 2s ease-in-out infinite;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1400px) {
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 1200px) {
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 992px) {
    #app {
        padding: 20px;
    }

    #pageTitle {
        font-size: 2rem;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }

    .image-grid img {
        height: auto;
        max-height: 360px;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 0;
        margin-bottom: 0;
    }

    #app {
        padding-bottom: 20px;
        margin-bottom: 0;
    }

    #pageTitle {
        font-size: 1.75rem;
        margin: 20px 0 30px;
    }

    .navbar-actions {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        align-content: center;
        align-items: center;
    }

    .nav-btn {
        min-width: 40px;
        padding: 8px 12px;
        font-size: 16px;
        flex: 0 0 auto;
        flex-basis: auto;
    }

    #checkBonusBtnMain {
        order: -1;
        flex-shrink: 0;
    }

    .nav-dropdown {
        flex-shrink: 0;
    }

    /* Responsive dropdown trên tablet */
    @media (max-width: 768px) {
        .dropdown-content {
            right: 0;
            left: auto;
            min-width: 200px;
        }
    }

    /* Điều chỉnh để button wrap đều hơn trên tablet */
    @media (max-width: 768px) and (min-width: 481px) {
        .navbar-actions {
            gap: 6px;
        }

        .nav-btn {
            min-width: 38px;
            padding: 7px 11px;
            font-size: 15px;
        }
    }

    .filter-btn,
    .date-btn {
        padding: 10px 14px;
        font-size: 12px;
        min-width: 50px;
        max-width: 100%;
        flex: 0 1 auto;
        border-radius: 20px;
        font-weight: 600;
    }

    .filter-buttons {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .pagination-container {
        gap: 6px;
        padding: 10px;
    }

    .pagination-button {
        padding: 10px 16px;
        font-size: 12px;
        min-width: 44px;
        border-radius: var(--radius-sm);
    }

    .pagination-info {
        padding: 8px 12px;
        font-size: 12px;
    }

    #controls,
    #filters,
    #dateFilters {
        padding: 16px;
        gap: 10px;
    }

    .button {
        padding: 12px 20px;
        font-size: 13px;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 14px;
    }

    .image-grid.columns-5,
    .image-grid.columns-6 {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .image-grid img {
        height: auto;
        max-height: 300px;
    }

    .floating-button.left {
        left: 20px;
    }

    .floating-button.right {
        right: 20px;
    }

    .floating-button .button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

@media (max-width: 576px) {
    body {
        padding-bottom: 0;
        margin-bottom: 0;
    }

    #app {
        padding: 12px;
        padding-bottom: 20px;
        margin-bottom: 0;
    }

    #pageTitle {
        font-size: 1.5rem;
        margin: 15px 0 20px;
    }

    .filter-group {
        margin-bottom: 12px;
    }

    .filter-label {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .filter-btn,
    .date-btn {
        padding: 9px 14px;
        font-size: 12px;
        min-width: 48px;
        border-radius: 20px;
    }

    .filter-buttons {
        gap: 8px;
        justify-content: space-between;
    }

    .pagination-container {
        gap: 4px;
        padding: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination-button {
        padding: 8px 12px;
        font-size: 11px;
        min-width: 40px;
        border-radius: 8px;
    }

    .pagination-info {
        padding: 6px 10px;
        font-size: 11px;
        width: 100%;
        text-align: center;
        order: -1;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }

    .image-grid img {
        height: auto;
        max-height: 240px;
    }

    .modal-content {
        margin: 20px auto;
        padding: 24px;
        max-width: 95%;
    }

    .close,
    .modal-close {
        top: 16px;
        right: 16px;
        font-size: 28px;
        width: 40px;
        height: 40px;
    }

    .modal-header {
        padding-right: 45px;
        /* Space for close button on mobile */
    }

    .close,
    .modal-close {
        top: 16px;
        right: 16px;
        font-size: 28px;
        width: 40px;
        height: 40px;
    }

    .modal-header {
        padding-right: 45px;
        /* Space for close button on mobile */
    }
}

@media (max-width: 400px) {
    body {
        padding-bottom: 0;
        margin-bottom: 0;
    }

    #app {
        padding: 10px;
        padding-bottom: 20px;
    }

    /* Navbar fixes for extra small screens */
    .navbar {
        padding: 14px 16px;
        flex-direction: column;
        gap: 12px;
    }

    .navbar-brand #pageTitle {
        font-size: 1.3rem;
    }

    .navbar-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }

    .nav-btn {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 15px;
    }

    /* Dropdown improvements */
    .dropdown-content {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        min-width: 90vw;
        max-width: 90vw;
    }

    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .filter-btn,
    .date-btn {
        padding: 8px 10px;
        font-size: 11px;
        min-width: 40px;
        max-width: 100%;
        flex: 0 1 auto;
        border-radius: 16px;
    }

    .filter-buttons {
        gap: 6px;
        justify-content: center;
        width: 100%;
    }

    .pagination-button {
        padding: 7px 10px;
        font-size: 10px;
        min-width: 36px;
    }

    .pagination-info {
        font-size: 10px;
        padding: 5px 8px;
    }

    .button {
        padding: 8px 12px;
        font-size: 12px;
    }

    #pageTitle {
        font-size: 1.25rem;
    }

    /* Modal improvements */
    .modal-content {
        margin: 8px;
        max-width: calc(100vw - 16px);
        padding: 0;
    }

    .modal-header {
        padding: 14px 16px;
        padding-right: 50px;
    }

    .modal-header h2 {
        font-size: 16px;
    }

    .modal-body {
        padding: 14px 16px;
    }

    .close {
        width: 36px;
        height: 36px;
        font-size: 28px;
        right: 8px;
        top: 8px;
    }
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
    border: 2px solid var(--bg-dark);
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--secondary-hover));
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-dark);
}

/* ===== SMOOTH SCROLLING ===== */
html {
    scroll-behavior: smooth;
}

/* ===== FOCUS STYLES ===== */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* ===== SELECTION ===== */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

/* ===== PASSWORD MODAL ===== */
.password-modal {
    max-width: 450px;
    padding: 0;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.2);
}

.password-modal-header {
    text-align: center;
    padding: 32px 32px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.password-modal-header h2 {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.password-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
    font-weight: 400;
}

.password-modal-body {
    padding: 32px;
}

.password-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: inherit;
}

.password-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), var(--shadow-glow);
    transform: translateY(-2px);
}

.password-input::placeholder {
    color: var(--text-muted);
}

.password-error {
    margin-top: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    font-size: 14px;
    text-align: center;
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.password-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 32px 32px;
    justify-content: flex-end;
}

.password-cancel-btn,
.password-submit-btn {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 100px;
}

.password-cancel-btn {
    background: var(--bg-dark);
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.password-cancel-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.password-submit-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow);
}

.password-submit-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.password-submit-btn:active {
    transform: translateY(0);
}

/* Scroll to Top Button */
.scroll-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    z-index: 1000;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .scroll-to-top-btn {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}

.scroll-to-top-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(236, 72, 153, 0.5);
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
}

.scroll-to-top-btn:active {
    transform: translateY(-2px) scale(1.05);
}

/* History Modal */
.modal-large {
    max-width: 900px;
    max-height: 90vh;
}

.history-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.history-input-group .input-prompt-field {
    flex: 1;
    min-width: 200px;
}

.history-content {
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}

@media (max-width: 768px) {
    .modal-large {
        max-width: 95%;
        margin: 10px;
        max-height: 95vh;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .modal-body {
        padding: 16px;
    }

    .history-input-group {
        flex-direction: column;
        gap: 8px;
    }

    .history-input-group .input-prompt-field {
        min-width: 100%;
        font-size: 14px;
        padding: 10px 12px;
    }

    .history-input-group .button {
        width: 100%;
        padding: 10px;
        font-size: 14px;
    }

    .history-content {
        max-height: 50vh;
        padding: 8px;
    }

    .history-message-item {
        padding: 10px;
    }

    .history-message-text {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .modal {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - env(safe-area-inset-bottom, 0px));
        max-height: calc(100dvh - env(safe-area-inset-bottom, 0px));
        /* Use dynamic viewport height */
        margin: 0;
        margin-bottom: env(safe-area-inset-bottom, 0px);
        border-radius: 0;
        animation: slideUpMobile 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .modal-large {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        max-height: calc(100vh - env(safe-area-inset-bottom, 0px));
        max-height: calc(100dvh - env(safe-area-inset-bottom, 0px));
        margin-bottom: env(safe-area-inset-bottom, 0px);
    }

    .modal-header {
        padding: 16px 44px 14px 16px;
        font-size: 18px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .modal-body {
        padding: 16px;
    }

    .close,
    .modal-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 22px;
    }

    .history-content {
        max-height: 60vh;
        padding: 6px;
    }
}

.history-messages-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-header-info {
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
}

.history-message-item {
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.history-message-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.history-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.history-sender-id {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

.history-timestamp {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-message-text {
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    margin: 8px 0;
}

.history-message-sticker,
.history-message-photo,
.history-message-video,
.history-message-other {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 8px 0;
    padding: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.history-likes {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Ensure buttons are not hidden */
.dialogue-actions,
.account-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

/* Account management buttons styling */
.account-inbox-btn {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.9));
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: #fff;
    font-weight: 500;
    transition: all 0.2s ease;
}

.account-inbox-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 1), rgba(37, 99, 235, 1));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.account-actions .button-small {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.account-actions .button-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.account-actions .info-button {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.account-actions .info-button:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
}

.account-actions .edit-button {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.account-actions .edit-button:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.5);
}

.account-actions .delete-button {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.account-actions .delete-button:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

.account-actions .ghost-button {
    background: rgba(107, 114, 128, 0.1);
    border: 1px solid rgba(107, 114, 128, 0.3);
    color: #6b7280;
}

.account-actions .ghost-button:hover {
    background: rgba(107, 114, 128, 0.2);
    border-color: rgba(107, 114, 128, 0.5);
}

.dialogue-card,
.account-card {
    position: relative;
    z-index: 1;
}

.dialogue-header-actions {
    position: relative;
    z-index: 10;
}

/* Fix z-index for buttons in cards */
.button-small {
    position: relative;
    z-index: 5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .account-actions .button-small {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(50% - 4px);
        font-size: 11px;
        padding: 6px 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .dialogue-header-actions .button {
        font-size: 13px;
        padding: 8px 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Profile Buttons Mobile Responsive */
@media (max-width: 768px) {
    .profile-buttons .button {
        flex: 1 1 100%;
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .profile-buttons .button-group h3 {
        font-size: 12px;
    }

    .profile-buttons .button {
        padding: 10px 12px;
        font-size: 13px;
    }
} 
 
/* ===== MOBILE DROPDOWN FIX ===== */
@media (max-width: 768px) {
    /* Fix dropdown width overflow on mobile */
    .dropdown-content {
        min-width: 200px;
        max-width: calc(100vw - 40px);
        right: 0;
        left: auto;
    }
    
    .dropdown-item-select .view-control-select {
        width: 100%;
        max-width: 100%;
        font-size: 13px;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    /* Even tighter constraints for very small screens */
    .dropdown-content {
        min-width: 180px;
        max-width: calc(100vw - 20px);
    }
    
    .dropdown-item-select .view-control-select {
        font-size: 12px;
        padding: 5px 8px;
    }
}
