:root {
    --primary-color: #1a4d2e; /* Xanh lá sẫm */
    --secondary-color: #2c6e49;
    --accent-color: #4ead7a; /* Xanh sáng hơn cho nút bấm */
    --text-light: #ffffff;
    --text-dark: #333333;
    --text-gray: #777777;
    --bg-light: #f4f7f6;
    --bg-card: #ffffff;
    --border-color: #eeeeee;
    --sidebar-width: 250px;
    --transition: all 0.3s ease;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    
    /* Toast Colors */
    --toast-success: #1a4d2e;
    --toast-error: #e74c3c;
    --toast-warning: #f39c12;
}

/* Base Styles to prevent white flash */
html {
    background-color: var(--bg-light);
    height: 100%;
}
body {
    background-color: var(--bg-light);
    min-height: 100%;
    margin: 0;
}
body.dark-mode {
    background-color: #121212; /* Dark mode background */
    color: #e0e0e0;
}
html.dark-mode {
    background-color: #121212;
}

/* Dark Mode Variables */
html.dark-mode, body.dark-mode {
    --primary-color: #1a4d2e; /* Keep brand color or slightly lighter? Keep for now */
    --text-dark: #e0e0e0;
    --text-gray: #b0b0b0;
    --bg-light: #121212;
    --bg-card: #1e1e1e;
    --border-color: #333333;
    --shadow: 0 4px 6px rgba(0,0,0,0.5);
    --input-bg: #2c2c2c;
    --input-border: #444444;
}

/* Dark Mode Specific Overrides */
html.dark-mode input, body.dark-mode input,
html.dark-mode textarea, body.dark-mode textarea,
html.dark-mode select, body.dark-mode select {
    background-color: var(--input-bg);
    color: var(--text-dark);
    border-color: var(--input-border);
}

html.dark-mode input:focus, body.dark-mode input:focus,
html.dark-mode textarea:focus, body.dark-mode textarea:focus,
html.dark-mode select:focus, body.dark-mode select:focus {
    border-color: var(--primary-color);
    background-color: #333;
}

html.dark-mode .sidebar, body.dark-mode .sidebar {
    border-right: 1px solid #333;
}

html.dark-mode .nav-links a, body.dark-mode .nav-links a {
    color: rgba(255, 255, 255, 0.6);
}

html.dark-mode .nav-links a:hover, body.dark-mode .nav-links a:hover,
html.dark-mode .nav-links li.active a, body.dark-mode .nav-links li.active a {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

html.dark-mode .btn-cancel, body.dark-mode .btn-cancel {
    background-color: #333;
    color: #eee;
}

html.dark-mode .btn-cancel:hover, body.dark-mode .btn-cancel:hover {
    background-color: #444;
}

html.dark-mode .notif-modal-content, body.dark-mode .notif-modal-content,
html.dark-mode .confirm-box, body.dark-mode .confirm-box {
    background-color: var(--bg-card);
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
}

html.dark-mode .notif-item:hover, body.dark-mode .notif-item:hover {
    background-color: #252525;
}

html.dark-mode .status-select-container, body.dark-mode .status-select-container {
    background-color: #252525;
    border-color: #333;
}

/* Dark Scrollbar */
html.dark-mode ::-webkit-scrollbar, body.dark-mode ::-webkit-scrollbar {
    width: 8px;
}
html.dark-mode ::-webkit-scrollbar-track, body.dark-mode ::-webkit-scrollbar-track {
    background: #121212;
}
html.dark-mode ::-webkit-scrollbar-thumb, body.dark-mode ::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}
html.dark-mode ::-webkit-scrollbar-thumb:hover, body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #555;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
    opacity: 1; /* Default visible */
}

/* Page Transition Class */
body.page-transition-exit {
    opacity: 0 !important;
    pointer-events: none;
}

.app-container {
    display: flex;
    flex: 1; /* Expand to fill available space */
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: var(--text-light);
    height: 100vh; /* Fixed height for sticky sidebar */
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: var(--transition);
    z-index: 1000;
}

.logo {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.logo span {
    font-size: 0.9rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0.8;
}

.nav-links {
    list-style: none;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nav-links li {
    margin-bottom: 10px;
}

.nav-links a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: rgba(255,255,255,0.7);
    padding: 12px 15px;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
}

.nav-links a:hover, .nav-links li.active a {
    background-color: var(--secondary-color);
    color: var(--text-light);
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.nav-links i {
    font-size: 1.2rem;
    width: 30px;
    text-align: center;
    margin-right: 10px;
}

.sidebar-footer {
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.5;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    transition: var(--transition);
    width: calc(100% - var(--sidebar-width)); /* Đảm bảo content không bị tràn */
}

.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.mobile-header h3 {
    margin-left: 15px;
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 700;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

.content-wrapper {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    min-height: 85vh;
    transition: background-color 0.3s ease;
}

/* Content Header & Buttons */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.content-header h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

.back-link {
    color: var(--text-dark);
    font-size: 1.2rem;
    text-decoration: none;
    transition: color 0.2s;
}

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

.btn-create-album {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    text-decoration: none; /* Dùng thẻ a thì cần bỏ gạch chân */
    box-shadow: 0 4px 6px rgba(26, 77, 46, 0.3);
}

.btn-create-album:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(26, 77, 46, 0.4);
}

/* Album Grid */
.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.album-card {
    background: var(--bg-card);
    border-radius: 12px;
    /* overflow: hidden; Removed to allow dropdown */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    cursor: pointer; /* Đảm bảo con trỏ chuột thay đổi khi hover */
    position: relative; /* Để z-index hoạt động nếu cần */
    z-index: 1;
}

.album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    z-index: 10; /* Bring to front on hover */
}

.album-card.active-z {
    z-index: 50 !important; /* Higher than hover and siblings */
}

.album-cover {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 12px 12px 0 0;
    position: relative;
    background-color: #f0f0f0; /* Fallback color */
    background-image: url('assets/default-cover.jpg'); /* Default */
}

.album-info {
    padding: 15px;
}

.album-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.album-info p {
    font-size: 0.9rem;
    color: var(--text-gray);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 0;
    color: var(--text-gray);
    display: none; /* Mặc định ẩn, sẽ hiện khi không có album */
}

.empty-state.active {
    display: block;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ddd;
}

.empty-state p {
    font-size: 1.1rem;
}

/* Badge trạng thái album */
.album-status {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    /* box-shadow: 0 2px 4px rgba(0,0,0,0.2); Remove shadow for inline style */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-wait-view { background-color: #3498db; } /* Xanh dương: Đợi khách xem */
.status-wait-select { background-color: #f39c12; } /* Cam: Đợi khách chọn */
.status-processing { background-color: #9b59b6; } /* Tím: Đang hậu kỳ */
.status-ready { background-color: #2ecc71; } /* Xanh lá: Sẵn sàng bàn giao */
.status-sent { background-color: #95a5a6; } /* Xám: Đã gửi */

/* Select box chọn trạng thái trong Edit Album */
.status-select-container {
    margin-bottom: 25px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

body.dark-mode .status-select-container {
    background: #252525;
}

.status-select-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-dark);
}

.status-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.status-option {
    display: none; /* Ẩn radio mặc định */
}

.status-option-label {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    opacity: 0.7;
}

/* Màu sắc cho từng option khi chưa chọn (viền màu) */
.status-option-label[for="status-wait-view"] { border-color: #3498db; color: #3498db; }
.status-option-label[for="status-wait-select"] { border-color: #f39c12; color: #f39c12; }
.status-option-label[for="status-processing"] { border-color: #9b59b6; color: #9b59b6; }
.status-option-label[for="status-ready"] { border-color: #2ecc71; color: #2ecc71; }
.status-option-label[for="status-sent"] { border-color: #95a5a6; color: #95a5a6; }

/* Khi được chọn */
.status-option:checked + .status-option-label {
    opacity: 1;
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.status-option:checked + .status-option-label[for="status-wait-view"] { background-color: #3498db; }
.status-option:checked + .status-option-label[for="status-wait-select"] { background-color: #f39c12; }
.status-option:checked + .status-option-label[for="status-processing"] { background-color: #9b59b6; }
.status-option:checked + .status-option-label[for="status-ready"] { background-color: #2ecc71; }
.status-option:checked + .status-option-label[for="status-sent"] { background-color: #95a5a6; }

/* Create Album Form Styles */
.create-album-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    background: var(--bg-card);
    color: var(--text-dark);
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 77, 46, 0.1);
}

/* Radio Group Styles */
.radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    user-select: none;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    margin: 0;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-gray);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(26, 77, 46, 0.05);
}

.upload-area i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #ccc;
}

.cover-preview {
    width: 100%;
    height: 300px;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    margin-top: 10px;
    display: none; /* Ẩn mặc định */
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

.btn-cancel {
    padding: 12px 25px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-dark);
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

body.dark-mode .btn-cancel {
    background: #333;
    color: #fff;
}

.btn-confirm {
    padding: 12px 30px;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 6px rgba(26, 77, 46, 0.3);
}

.btn-confirm:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Login/Register Container */
.login-container {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 400px;
    text-align: center;
    margin: auto; /* Center vertically in flex body */
}

.login-logo {
    margin-bottom: 30px;
}

.login-logo h1 {
    font-size: 1.8rem;
    letter-spacing: 2px;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
    background: var(--bg-card);
    color: var(--text-dark);
}

.login-form input:focus {
    border-color: var(--primary-color);
}

.login-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background-color: var(--secondary-color);
}

.links {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.links a {
    color: var(--text-gray);
    text-decoration: none;
    transition: color 0.3s;
}

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

.error-msg {
    color: var(--toast-error);
    font-size: 0.9rem;
    margin-top: 15px;
    display: none;
}

/* =========================================
   CUSTOM TOAST NOTIFICATION STYLES (Modern & Beautiful)
   ========================================= */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    min-width: 320px;
    max-width: 450px;
    padding: 16px 20px;
    border-radius: 12px;
    background: var(--bg-card);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    color: var(--text-dark); /* Text tối màu trên nền trắng */
    font-size: 0.95rem;
    font-weight: 500;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-left: 5px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s;
}

.toast:hover {
    transform: translateX(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.toast.hide {
    animation: slideOutRight 0.4s ease forwards;
}

.toast i {
    font-size: 1.4rem;
    margin-right: 15px;
    flex-shrink: 0;
}

/* Toast Variants */
.toast.success {
    border-left-color: #2ecc71;
}
.toast.success i {
    color: #2ecc71;
}

.toast.error {
    border-left-color: #e74c3c;
}
.toast.error i {
    color: #e74c3c;
}

.toast.warning {
    border-left-color: #f39c12;
}
.toast.warning i {
    color: #f39c12;
}

.toast.info {
    border-left-color: #3498db;
}
.toast.info i {
    color: #3498db;
}

/* Progress bar cho toast (optional) */
.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(0,0,0,0.05);
}

/* Status Dropdown Menu */
.status-dropdown-menu {
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    z-index: 1000;
}

.status-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.status-item:hover {
    background: #f5f5f5;
}

body.dark-mode .status-item:hover {
    background: #333;
}

.status-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* =========================================
   CUSTOM CONFIRM MODAL STYLES
   ========================================= */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.confirm-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirm-box {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: scale(0.8);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.confirm-overlay.active .confirm-box {
    transform: scale(1);
}

.confirm-icon {
    font-size: 3rem;
    color: var(--toast-warning);
    margin-bottom: 15px;
}

.confirm-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.confirm-text {
    font-size: 1rem;
    color: var(--text-gray);
    margin-bottom: 25px;
}

.confirm-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-confirm-yes, .btn-confirm-no {
    padding: 10px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-confirm-yes {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-confirm-yes:hover {
    background-color: var(--secondary-color);
}

.btn-confirm-no {
    background-color: #f0f0f0;
    color: var(--text-dark);
}

body.dark-mode .btn-confirm-no {
    background-color: #333;
    color: #fff;
}

.btn-confirm-no:hover {
    background-color: #e0e0e0;
}

body.dark-mode .btn-confirm-no:hover {
    background-color: #444;
}

/* =========================================
   FOOTER STYLES
   ========================================= */
.site-footer {
    background-color: #1a4d2e;
    color: #fff;
    padding: 20px 0;
    margin-top: auto; /* Push to bottom if using flex column on body */
    text-align: center;
    border-top: 5px solid #2c6e49;
    width: 100%;
    position: relative;
    z-index: 10;
    padding-left: var(--sidebar-width); /* Avoid overlap with fixed sidebar */
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    font-size: 0.9rem;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-item i {
    color: #4ead7a;
}

.footer-link {
    color: #fff;
    text-decoration: none;
    border-bottom: 1px dashed rgba(255,255,255,0.5);
    transition: all 0.2s;
}

.footer-link:hover {
    color: #4ead7a;
    border-bottom-style: solid;
}

.copyright {
    margin-top: 15px;
    font-size: 0.8rem;
    opacity: 0.7;
    width: 100%;
}

/* =========================================
   SELECT PHOTOS PAGE STYLES (Modern UI)
   ========================================= */
.selection-container {
    padding-bottom: 100px; /* Space for floating bar */
    background-color: #f8f9fa;
    min-height: 100vh;
}

body.dark-mode .selection-container {
    background-color: #121212;
}

/* Hero Header */
.album-header {
    position: relative;
    padding: 60px 20px;
    text-align: center;
    background-color: var(--primary-color);
    color: #fff;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Background mờ cho header */
.album-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--header-bg); /* Sử dụng CSS Variable */
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.4);
    z-index: 0;
    opacity: 0.8;
}

.album-header-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.album-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.album-meta {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.album-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.album-meta i {
    color: var(--accent-color);
}

/* Photo Grid Improvements */
.photo-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    padding: 12px 0 !important;
    gap: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

@media (max-width: 1100px) {
    .photo-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 14px !important;
    }
}

@media (max-width: 680px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 10px 0 !important;
    }
}

.photo-item {
    position: relative;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.04);
    background: #fff;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.photo-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
    z-index: 2;
}

/* Photo Code Styling - Nhỏ gọn hơn */
.photo-code {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.6);
    padding: 4px 2px;
    font-family: 'Arial', sans-serif;
    font-size: 0.7rem; /* Chữ nhỏ */
    color: #fff;
    text-align: center;
    z-index: 5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 0;
    pointer-events: none;
}

/* Ẩn badge Đã chọn cũ đi vì ta sẽ style lại nút tim */
.selected-badge {
    display: none !important; 
}

/* Nút Select (Trái tim) */
.select-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.3); /* Nền tối mờ */
    color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    opacity: 1; /* Luôn hiện */
    box-shadow: none;
    transform: scale(1);
}

.photo-item:hover .select-btn {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    transform: scale(1.1);
}

/* Trạng thái đã chọn */
.photo-item.selected .select-btn {
    background: #e74c3c;
    color: #fff;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.4);
    animation: heartBeat 0.3s ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Viền ảnh khi chọn */
.photo-item.selected img {
    outline: none; /* Bỏ viền cũ */
}

/* Thêm lớp phủ màu nhẹ khi chọn */
.photo-item.selected::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(231, 76, 60, 0.1); /* Phủ màu đỏ rất nhạt */
    border: 3px solid #e74c3c;
    border-radius: 12px;
    pointer-events: none;
    z-index: 6;
    box-sizing: border-box;
}

.photo-code:hover {
    background: #fff;
    color: #333;
    font-weight: 700;
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.lightbox-modal.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}

.lightbox-close:hover {
    color: #e74c3c;
}

/* Nút download trong Lightbox */
.lightbox-download {
    position: absolute;
    bottom: -60px; /* Nằm dưới ảnh */
    right: 0;
    color: #fff;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.lightbox-download:hover {
    background: #fff;
    color: #333;
    transform: translateY(-3px);
}

/* Floating Selection Bar (Glassmorphism) */
.selection-bar {
    position: fixed; /* Quan trọng: để float */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 25px;
    border-radius: 50px;
    bottom: 40px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    gap: 25px;
    display: flex; /* Để căn chỉnh nội dung bên trong */
    align-items: center;
    z-index: 10000; /* Tăng z-index lên cao nhất */
    transition: all 0.3s ease;
    white-space: nowrap; /* Không xuống dòng */
}

.selection-bar.hidden {
    bottom: -100px; /* Ẩn xuống dưới thay vì display: none để có hiệu ứng trượt */
    opacity: 0;
    pointer-events: none;
}

/* Photo Overlay (Bổ sung để không chặn click) */
.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.6) 100%);
    pointer-events: none; /* Quan trọng: Cho phép click xuyên qua */
    z-index: 2;
    border-radius: 12px;
}

.selection-count {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.selection-count::before {
    content: '\f00c';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    background: #2ecc71;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.btn-send-selection {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: #fff;
    padding: 10px 25px;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(211, 84, 0, 0.4);
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 30px; /* Bo tròn nút */
    font-weight: 600;
    cursor: pointer;
}

.btn-send-selection:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 84, 0, 0.5);
    background: linear-gradient(135deg, #d35400, #e67e22);
}

/* =========================================
   NOTIFICATION STYLES
   ========================================= */
.notif-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-dark);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.notif-btn:hover {
    background: #f0f0f0;
    color: var(--primary-color);
}

body.dark-mode .notif-btn:hover {
    background: #333;
}

.notif-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid #fff;
    display: block;
}

body.dark-mode .notif-badge {
    border-color: #333;
}

.notif-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none; /* Hidden by default */
}

.notif-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.notif-modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: 12px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    animation: slideUp 0.3s ease;
}

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

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

.notif-header h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-notif {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
}

.close-notif:hover {
    color: var(--text-dark);
}

.notif-list {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.notif-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
    /* Styles for collapsing */
    max-height: 120px; /* Default collapsed height */
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.notif-item.expanded {
    max-height: none; /* Expand fully */
    background: #f9f9f9;
}

body.dark-mode .notif-item.expanded {
    background: #252525;
}

.notif-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(transparent, var(--bg-card));
    pointer-events: none;
    transition: opacity 0.2s;
}

.notif-item.expanded::after {
    opacity: 0;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: #f9f9f9;
}

body.dark-mode .notif-item:hover {
    background: #252525;
}

.notif-item-title {
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Override previous pseudo-element arrow to avoid duplication with JS icon */
.notif-item-title::after {
    content: none !important;
}

.notif-item.expanded i.fa-chevron-down {
    transform: rotate(180deg);
}

.notif-item-content {
    font-size: 0.95rem;
    color: var(--text-gray);
    margin-bottom: 8px;
    line-height: 1.5;
    word-break: break-word; /* Prevent overflow */
    white-space: pre-line; /* Handle newlines natively as backup */
}

.notif-item-time {
    font-size: 0.8rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Bell Shake Animation - Applied to Button */
@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    10% { transform: rotate(25deg); }
    20% { transform: rotate(-25deg); }
    30% { transform: rotate(15deg); }
    40% { transform: rotate(-15deg); }
    50% { transform: rotate(10deg); }
    60% { transform: rotate(-10deg); }
    70% { transform: rotate(0); }
}

.notif-shake {
    animation: bellShake 2s infinite ease-in-out;
    border-color: #e74c3c !important;
    color: #e74c3c !important;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

.notif-shake i {
    /* Remove individual icon animation to avoid conflict */
    animation: none !important;
    color: #e74c3c !important;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .album-header h1 {
        font-size: 1.8rem;
    }
    
    .photo-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        padding: 0 10px;
        gap: 10px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .site-footer {
        padding-left: 0; /* Reset padding on mobile */
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 15px;
    }

    .mobile-header {
        display: flex; /* Hiện header mobile */
    }

    .content-wrapper {
        padding: 20px;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .btn-create-album {
        width: 100%;
        justify-content: center;
    }

    /* Floating Bar Mobile Optimization */
    .selection-bar {
        width: 90%; /* Rộng hơn trên mobile */
        max-width: 400px;
        padding: 10px 20px;
        bottom: 20px;
        justify-content: space-between; /* Căn đều 2 bên */
        gap: 10px;
    }

    .selection-count {
        font-size: 1rem;
    }

    .btn-send-selection {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
    
    /* Hide desktop notif btn in mobile */
    #desktopNotifBtn {
        display: none;
    }
    
    /* Adjust content header row direction for mobile to keep button right if needed, but flex-direction is column. 
       Actually, above .content-header is flex-direction: column. 
       Let's adjust .content-header div (the one with buttons) to be full width/flex 
    */
    .content-header > div {
        width: 100%;
        justify-content: space-between;
    }
}

/* Album Type Badges (Global) */
.album-type-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255,255,255,0.2);
}

.type-select {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.type-product {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

.album-type-badge i {
    font-size: 0.85rem;
}
