/*
 * style.css
 * כל קוד ה-CSS מהבלוק <style> נכנס לכאן.
 */

:root {
    /* Background Colors */
    --bg-color: #0f0f14;
    --card-bg: #1a1a24;

    /* Primary Gold Colors */
    --primary: hsl(45, 80%, 55%);
    --primary-gold: hsl(45, 80%, 55%);
    --gold-light: hsl(45, 70%, 70%);
    --gold-dark: hsl(45, 80%, 40%);

    /* Legacy support (will be gradually replaced) */
    --primary-blue: hsl(45, 80%, 55%);

    /* Text Colors */
    --text-main: #e2e8f0;
    --text-dim: #94a3b8;

    /* Border & Accent */
    --border-color: #2a2a3a;
    --accent-green: #4ade80;

    /* Additional Colors */
    --accent: hsl(45, 60%, 45%);
    --secondary: hsl(240, 6%, 15%);
    --muted: hsl(240, 6%, 18%);

    /* Shadows */
    --shadow-glow: 0 0 30px -5px hsl(45 80% 55% / 0.15);
    --shadow-hover: 0 16px 48px -12px hsl(45 80% 55% / 0.2);
    --shadow-card: 0 8px 32px -8px hsl(0 0% 0% / 0.4);
}

body[data-theme="light"] {
    /* Background Colors */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;

    /* Primary Gold Colors */
    --primary: hsl(45, 75%, 50%);
    --primary-gold: hsl(45, 75%, 50%);
    --gold-light: hsl(45, 65%, 65%);
    --gold-dark: hsl(45, 75%, 35%);

    /* Legacy support */
    --primary-blue: hsl(45, 75%, 50%);

    /* Text Colors */
    --text-main: #1e293b;
    --text-dim: #475569;

    /* Border & Accent */
    --border-color: #cbd5e1;
    --accent-green: #16a34a;

    /* Additional Colors */
    --accent: hsl(45, 55%, 40%);
    --secondary: hsl(240, 6%, 90%);
    --muted: hsl(240, 6%, 85%);

    /* Shadows */
    --shadow-glow: 0 0 30px -5px hsl(45 75% 50% / 0.2);
    --shadow-hover: 0 16px 48px -12px hsl(45 75% 50% / 0.25);
    --shadow-card: 0 8px 32px -8px hsl(0 0% 0% / 0.15);
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    margin: 0; padding: 0;
    direction: rtl;
    transition: background-color 0.3s, color 0.3s;
}

/* --- Theme Toggle Button --- */
#theme-toggle .icon-sun { display: none; }
#theme-toggle .icon-moon { display: block; }

body[data-theme="light"] #theme-toggle .icon-sun { display: block; }
body[data-theme="light"] #theme-toggle .icon-moon { display: none; }

/* Adjustments for light theme */
body[data-theme="light"] .navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
}

body[data-theme="light"] input, 
body[data-theme="light"] select,
body[data-theme="light"] textarea {
    background: #f1f5f9;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

body[data-theme="light"] .btn-navbar-action:hover {
    background: #f1f5f9;
}

body[data-theme="light"] .btn-google {
    background: #f8f8f8;
    border: 1px solid #ddd;
    color: #333;
}

body[data-theme="light"] .view-switcher button:hover {
    background: #eee;
}

body[data-theme="light"] .book-img {
    background: #e2e8f0;
}

body[data-theme="light"] .book-meta {
    border-top: 1px solid #e2e8f0;
}

body[data-theme="light"] .books-list-view .book-card:hover {
    background: rgba(59, 130, 246, 0.08);
}

body[data-theme="light"] .book-actions {
    border-top: 1px solid #e2e8f0;
}

body[data-theme="light"] .btn-cancel {
    background: #e2e8f0;
}
body[data-theme="light"] .btn-cancel:hover {
    background: #d1d5db;
}

body[data-theme="light"] .share-buttons,
body[data-theme="light"] .owner-actions {
    border-top: 1px solid var(--border-color);
}

body[data-theme="light"] .share-btn:hover {
    background: #e5e7eb;
}

body[data-theme="light"] .skeleton-card .skeleton-img,
body[data-theme="light"] .skeleton-card .skeleton-text,
body[data-theme="light"] .skeleton-card-list .skeleton-img-list {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer-light 1.5s infinite ease-in-out;
}

@keyframes shimmer-light {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes pulse-light {
    0% { background-color: #e2e8f0; }
    50% { background-color: #f1f5f9; }
    100% { background-color: #e2e8f0; }
}

body[data-theme="light"] .autocomplete-items {
    border-color: #e5e7eb;
}

body[data-theme="light"] .autocomplete-items div {
    background-color: #ffffff;
    border-bottom-color: #e5e7eb;
}

body[data-theme="light"] .autocomplete-items div:hover {
    background-color: #f3f4f6;
}

body[data-theme="light"] #contactSellerSection textarea {
    background: #f1f5f9;
    color: var(--text-main);
}
/* Focus Styles for Accessibility */
*:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

button:focus, a:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Skip to content (for screen readers and keyboard nav) */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-blue);
    color: white;
    padding: 10px 20px;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    text-decoration: none;
    font-weight: bold;
}

.skip-to-content:focus {
    top: 0;
}

/* סרגל עליון - Modern Glassmorphism */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 15, 20, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shrunk navbar state */
.navbar.shrunk {
    padding: 8px 30px;
    background: rgba(15, 15, 20, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar.shrunk .logo {
    transform: scale(0.9);
}

body[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.9);
}

body[data-theme="light"] .navbar.shrunk {
    background: rgba(255, 255, 255, 0.98);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 20px;
    transition: transform 0.3s ease;
    transform-origin: right center;
}

/* פריסה מרכזית */
.main-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    max-width: 1400px; /* Restored to original width */
    margin: 15px auto;
    padding: 0 15px;
    transition: grid-template-columns 0.3s ease;
}

.content-area {
    min-width: 0; /* CRITICAL: Fixes grid blowout from horizontal scroll */
    width: 100%;
}

/* Hero Section - Ken Burns Effect */
.hero-container {
    grid-column: 1 / -1;
    position: relative;
    width: 100%;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
    background-color: var(--card-bg);
}

.hero-image {
    width: 100%;
    height: 100%;
    background-image: url('hero-vintage.webp');
    background-size: cover;
    background-position: center;
    animation: kenburns 20s infinite alternate;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent 50%);
    pointer-events: none;
}

@keyframes kenburns {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); }
}

@media (max-width: 800px) {
    .hero-container {
        height: 180px;
        margin-bottom: 15px;
    }
}

.main-layout.side-panel-collapsed {
    grid-template-columns: 0px 1fr;
    gap: 0;
}

.main-layout.side-panel-collapsed .side-panel {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    padding: 0;
    margin: 0;
    width: 0;
    overflow: hidden;
}

/* Side Panel Toggle Button (Desktop) */
.btn-toggle-filters {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-blue);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-toggle-filters:hover {
    transform: scale(1.1);
    background: var(--gold-light);
}

.btn-toggle-filters.active {
    background: #444;
}

@media (max-width: 800px) { 
    .main-layout { grid-template-columns: 1fr; }
    .btn-toggle-filters { display: none; } /* Mobile uses its own menu button */
}

/* פאנל צדדי */
.side-panel { 
    background: var(--card-bg); 
    padding: 20px; 
    border-radius: 12px; 
    height: fit-content;
    position: sticky;
    top: 85px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

input, select {
    width: 100%; padding: 8px; margin: 6px 0;
    background: #1e1e26; border: 1px solid var(--border-color);
    border-radius: 6px; color: white; box-sizing: border-box;
    font-size: 14px;
}

/* Highlight Search Input - Subtle & Clean */
#searchInput {
    border: 2px solid var(--primary-blue); /* Distinct border color */
    background: #1e1e26; /* Standard dark input bg */
    transition: all 0.3s ease;
}

body[data-theme="light"] #searchInput {
    background: #ffffff; /* Standard light input bg */
    border-color: var(--primary-blue);
}

#searchInput:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); /* Soft focus ring */
    border-color: var(--primary-blue);
}

.btn { 
    width: 100%; padding: 12px; border-radius: 6px; border: none; 
    cursor: pointer; font-weight: bold; margin-top: 10px; transition: 0.2s;
}
.btn-primary { background: var(--primary-blue); color: white; }
.btn-primary:hover { opacity: 0.9; }
.btn-navbar-action {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
}

.btn-navbar-action:hover {
    background: var(--card-bg);
    border-color: var(--primary-blue);
}

.btn-google { 
    background: white; 
    color: #333;
    padding: 5px 15px; 
    width: auto; 
    font-size: 14px;
}

.btn-logout {
    background:none; 
    border:none; 
    color:#ff4d4d; 
    cursor:pointer; 
    margin-right:10px;
}

.btn-logout:hover {
    text-decoration: underline;
}

/* כפתורי בורר תצוגה */
.view-switcher button {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 15px;
    margin-right: 5px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}
.view-switcher button:hover { background: #333; }
.view-switcher .active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}

/* --- לוח הספרים: תצוגת משבצות (GRID) - ברירת מחדל --- */
.content-area { }
.search-bar { margin-bottom: 20px; }

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.book-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}
.books-grid .book-card { flex-direction: column; }

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.book-img-container {
    position: relative;
    overflow: hidden;
}

.book-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: #333;
    transition: transform 0.7s ease;
}

.book-card:hover .book-img {
    transform: scale(1.1);
}

.book-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-card:hover .book-img-overlay {
    opacity: 1;
}

.book-info {
    padding: 12px;
    text-align: right;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 15px;
    font-weight: bold;
    display: block; /* Fallback */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.6em; /* 2 lines * 1.3 line-height */
    margin-bottom: 3px;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.book-card:hover .book-title {
    color: var(--primary);
}

.book-author {
    color: var(--text-dim);
    font-size: 13px;
    display: block; /* Fallback */
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-price {
    color: var(--primary);
    font-weight: bold;
    font-size: 18px;
    margin-top: 5px;
    display: block;
}

.book-meta {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.book-meta b {
    color: var(--text-main);
}

/* --- לוח הספרים: תצוגת שורות (LIST) --- */
.books-list-view {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.books-list-view .book-card {
    display: grid;
    grid-template-columns: 35px 1fr auto;
    align-items: center;
    padding: 5px 10px;
    border-radius: 4px;
    gap: 10px;
    height: auto;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.books-list-view .book-card::after {
    content: '◀';
    color: var(--text-dim);
    font-size: 10px;
    opacity: 0.4;
    transition: all 0.15s;
}

.books-list-view .book-card:hover {
    background: rgba(59, 130, 246, 0.08);
    transform: translateX(-2px);
}

.books-list-view .book-card:hover::after {
    opacity: 1;
    color: var(--primary-blue);
}

.books-list-view .book-img {
    width: 35px;
    height: 35px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.books-list-view .book-info {
    padding: 0;
    display: flex; /* Changed from flex-direction: column to row implicitly */
    flex: 1; /* Allow book-info to take available space */
    align-items: baseline; /* Align items to the bottom of the flex container */
    justify-content: space-between; /* Distribute space between items */
    text-align: right;
    min-width: 0;
    overflow: hidden; /* Hide overflow */
}

.books-list-view .book-info-details {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap; /* Allow wrapping if content is too long */
    gap: 5px; /* Space between title and author */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.books-list-view .book-title-inline {
    font-size: 14px; /* Slightly increased font size */
    font-weight: bold; /* Make title bolder */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
    line-height: 1.2;
}

.books-list-view .book-author-inline {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
    line-height: 1.2;
}

.books-list-view .book-price {
    margin-left: auto; /* Push price to the left (right in RTL) */
    flex-shrink: 0;
    font-size: 16px; /* Increased font size for price */
    font-weight: bold;
    color: var(--accent-green);
    padding-left: 10px; /* Space between text and price */
    white-space: nowrap;
}

/* Hide ALL elements in list view except title, author, price */
.books-list-view .book-meta,
.books-list-view .book-actions,
.books-list-view .book-contact,
.books-list-view .share-buttons,
.books-list-view .book-analytics,
.books-list-view .sold-badge {
    display: none !important;
}

/* Sold books in list view */
.books-list-view .book-card-sold {
    opacity: 0.6;
}

.books-list-view .book-card-sold .book-img {
    filter: grayscale(40%);
}

/* Visually hidden but accessible label - Modern standard for Lighthouse 100% accessibility */
.hidden-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* התאמה למסכים קטנים */
@media (max-width: 600px) {
    .books-list-view .book-card { flex-direction: column; align-items: flex-start; }
    .books-list-view .book-img { margin-left: 0; margin-bottom: 10px; }
    .books-list-view .book-info { flex-direction: column; align-items: flex-start; gap: 5px; }
    .books-list-view .book-price { margin-right: 0; margin-top: 10px; }
    .books-list-view .book-meta { flex-direction: column; gap: 5px; }
}

.hidden { display: none !important; }

/* Loading Spinner */
#loading {
    color: var(--primary-blue);
    font-size: 14px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Filtering indicator */
.filtering-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-blue);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.filtering-indicator .spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-color: rgba(255,255,255,0.3);
    border-top-color: white;
}

/* Fade in animation for books */
.books-grid, .books-list-view {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* New Animations Phase 1 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book-card {
    /* Existing styles... */
    animation: fadeInUp 0.5s ease-out forwards;
    /* Add staggered delay via JS or nth-child if possible, but basic animation first */
}

@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.pulsing {
    animation: heartPulse 0.4s ease-in-out;
}

@keyframes spinIcon {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin-animation {
    animation: spinIcon 0.5s ease-in-out;
}

/* Loading overlay for initial page load */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 30, 38, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    gap: 15px;
}

.loading-overlay .spinner {
    width: 50px;
    height: 50px;
    border-width: 4px;
}

.loading-overlay p {
    color: var(--text-main);
    font-size: 16px;
}

/* Notification toast */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10000;
    min-width: 250px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification.success { border-right: 4px solid var(--accent-green); }
.notification.error { border-right: 4px solid #ff4d4d; }
.notification.info { border-right: 4px solid var(--primary-blue); }

/* Delete & Edit buttons on book cards */
.book-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #333;
}

.book-actions button {
    flex: 1;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: 0.2s;
}

.btn-edit {
    background: var(--primary-blue);
    color: white;
}

.btn-edit:hover {
    opacity: 0.8;
}

.btn-delete {
    background: #ff4d4d;
    color: white;
}

.btn-delete:hover {
    background: #ff3333;
}

/* Confirmation Dialog */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    animation: fadeIn 0.2s ease-out;
    padding: 20px;
    overflow-y: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dialog-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    max-width: 450px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    animation: slideUp 0.3s ease-out;
    margin: auto;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.dialog-box h3 {
    margin: 0 0 15px;
    color: var(--text-main);
}

.dialog-box p {
    color: var(--text-dim);
    margin: 0 0 20px;
    line-height: 1.5;
}

.dialog-box p strong {
    color: var(--text-main);
    font-weight: 600;
}

.dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.dialog-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.btn-cancel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-cancel:hover {
    background: #333;
}

.btn-confirm {
    background: #ff4d4d;
    color: white;
}

.btn-confirm:hover {
    background: #ff3333;
}

.btn-confirm-external {
    background: var(--primary-blue);
    color: white;
}

.btn-confirm-external:hover {
    opacity: 0.9;
}

/* Book Details Modal */
.book-details-overlay {
    background: rgba(0, 0, 0, 0.9) !important;
}

.book-details-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    max-width: 900px;
    width: 90%;
    height: 600px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.3s ease-out;
    position: relative;
    margin: auto;
    display: flex;
    flex-direction: column;
}

/* --- Range Slider Styles --- */
.range-slider-container {
    position: relative;
    width: 100%;
    height: 30px;
    margin-top: 5px;
}

.range-slider-container input[type="range"] {
    position: absolute;
    width: 100%;
    pointer-events: none;
    appearance: none;
    -webkit-appearance: none;
    z-index: 2;
    height: 5px;
    background: none;
    outline: none;
    margin: 0;
    padding: 0;
    top: 50%;
    transform: translateY(-50%);
}

.range-slider-container input[type="range"]::-webkit-slider-thumb {
    pointer-events: all;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    -webkit-appearance: none;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.range-slider-container input[type="range"]::-moz-range-thumb {
    pointer-events: all;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.slider-track {
    position: absolute;
    width: 100%;
    height: 5px;
    background: var(--border-color);
    border-radius: 5px;
    z-index: 1;
    top: 50%;
    transform: translateY(-50%);
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.close-modal-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.book-details-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    padding: 30px;
    height: 100%;
    overflow: hidden;
}

.book-details-image {
    width: 350px;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a20;
}

.book-details-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.book-details-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-left: 10px;
    padding-right: 5px;
}

.book-details-info::-webkit-scrollbar {
    width: 8px;
}

.book-details-info::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.book-details-info::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.book-details-info::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.book-details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.book-details-header h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 24px;
}

.book-author-large {
    color: var(--text-dim);
    font-size: 16px;
    margin: 5px 0 0;
}

.book-price-large {
    font-size: 28px;
    font-weight: bold;
    color: var(--accent-green);
}

.favorite-btn-large {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: 0.2s;
    flex-shrink: 0;
}

.favorite-btn-large:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.favorite-btn-large.active {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.2);
}

.status-badge {
    display: inline-block;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.sold-badge-large {
    background: var(--accent-green);
    color: white;
}

.available-badge-large {
    background: var(--primary-blue);
    color: white;
}

.book-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    color: var(--text-dim);
    font-size: 13px;
}

.detail-value {
    color: var(--text-main);
    font-size: 15px;
    font-weight: 500;
}

.phone-link-large {
    color: var(--accent-green);
    text-decoration: none;
    font-size: 16px;
}

.phone-link-large:hover {
    text-decoration: underline;
}

.book-analytics-full h4,
.share-buttons-large h4 {
    margin: 0 0 10px;
    color: var(--text-main);
    font-size: 16px;
}

.analytics-grid {
    display: flex;
    gap: 20px;
}

.analytics-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.analytics-icon {
    font-size: 24px;
}

.analytics-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-blue);
}

.analytics-label {
    font-size: 12px;
    color: var(--text-dim);
}

.share-btn-large {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    color: var(--text-main);
    font-size: 13px;
}

.share-btn-large:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-blue);
    transform: translateY(-2px);
}

.owner-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.btn-action {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: 0.2s;
}

.btn-action.btn-edit {
    background: var(--primary-blue);
    color: white;
}

.btn-action.btn-sold {
    background: var(--accent-green);
    color: white;
}

.btn-action.btn-available {
    background: #fbbf24;
    color: #1e1e26;
}

.btn-action.btn-delete {
    background: #ff4d4d;
    color: white;
}

.btn-action:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 900px) {
    .book-details-box {
        height: 90vh;
        width: 95%;
    }

    .book-details-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }

    .book-details-image {
        width: 100%;
        height: 250px;
    }

    .book-details-info {
        padding-left: 0;
    }

    .book-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Hidden on desktop, visible on mobile */
.hidden-on-desktop {
    display: none !important;
}

@media (max-width: 800px) {
    .hidden-on-desktop {
        display: flex !important; /* Adjust as needed for specific element type */
    }

    .main-layout {
        grid-template-columns: 1fr; /* Stack content on mobile */
    }

    .side-panel {
        position: fixed;
        top: 0;
        bottom: 0;
        right: 0; /* For RTL, slide from right */
        width: 85%; /* Slightly less than 100% to show background */
        max-width: 320px;
        z-index: 2000;
        transform: translateX(100%); /* Hidden by default */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -5px 0 25px rgba(0,0,0,0.5);
        border-radius: 0;
        overflow-y: auto;
    }

    .side-panel.side-panel-open {
        transform: translateX(0); /* Slide into view */
    }

    .side-panel-overlay {
        z-index: 1999;
    }
}

/* Chat UI Styles */
.chat-container {
    display: flex;
    height: 100%;
    overflow: hidden;
    background: var(--card-bg);
    border-radius: 8px;
}

.chat-sidebar {
    width: 300px;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-color);
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    position: relative;
}

.conversation-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.conversation-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-right: 3px solid var(--primary-blue);
}

.conversation-item.unread {
    font-weight: bold;
}

.conversation-item.unread::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--primary-blue);
    border-radius: 50%;
}

.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 12px;
    position: relative;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-bubble.sent {
    align-self: flex-start; /* RTL: sent by me is on right, actually flex-start in RTL is right */
    background: var(--primary-blue);
    color: white;
    border-bottom-right-radius: 2px;
}

.message-bubble.received {
    align-self: flex-end; /* RTL: received is on left */
    background: var(--bg-color); /* darker bg for received */
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-bottom-left-radius: 2px;
}

.message-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: left;
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input-area textarea {
    flex: 1;
    resize: none;
    max-height: 100px;
    min-height: 40px;
    border-radius: 20px;
    padding: 10px 15px;
}

/* Mobile Chat adjustments */
@media (max-width: 700px) {
    .chat-container.viewing-chat .chat-sidebar {
        display: none;
    }
    .chat-container:not(.viewing-chat) .chat-main {
        display: none;
    }
    .chat-sidebar {
        width: 100%;
        border: none;
    }
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
    min-width: 40px;
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
}

.pagination button.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    font-weight: bold;
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-info {
    color: var(--text-dim);
    font-size: 13px;
    margin: 0 10px;
}

/* Sold Book Badge & Styling */
.sold-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-green);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.book-card-sold {
    opacity: 0.7;
    position: relative;
}

.book-card-sold .book-img {
    filter: grayscale(50%);
}

.btn-sold {
    background: var(--accent-green);
    color: white;
}

.btn-sold:hover {
    opacity: 0.8;
}

.btn-available {
    background: #fbbf24;
    color: #1e1e26;
}

.btn-available:hover {
    background: #f59e0b;
}

/* Favorite Button (Heart) */
.favorite-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.2);
}

.favorite-btn.active:hover {
    background: rgba(255, 77, 77, 0.3);
}

/* Favorites Badge */
.favorites-badge {
    background: #ff4d4d;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

#btnFavoritesPage:hover {
    background: var(--card-bg);
    border-color: var(--primary-blue);
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #333;
}

.share-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-btn:hover {
    background: #333;
    border-color: var(--primary-blue);
    transform: scale(1.05);
}

.share-whatsapp:hover {
    border-color: #25D366;
}

.share-copy:hover {
    border-color: var(--accent-green);
}

/* Contact Button */
.book-contact {
    margin-top: auto;
    padding-top: 10px;
}

.btn-show-phone {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: background-color 0.2s;
    width: 100%;
}

.btn-show-phone:hover {
    background-color: #0056b3;
}

.phone-link {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
}

/* Skeleton Loading */
.skeleton-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.skeleton-card .skeleton-img {
    height: 180px;
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite ease-in-out;
}

.skeleton-card .skeleton-text {
    height: 20px;
    margin: 15px 15px 0;
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shimmer 1.5s infinite ease-in-out;
}

.skeleton-card .skeleton-text.short {
    width: 60%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes pulse {
    0% { background-color: #333; }
    50% { background-color: #444; }
    100% { background-color: #333; }
}

.skeleton-card-list {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid var(--border-color);
}

.skeleton-card-list .skeleton-img-list {
    width: 80px;
    height: 80px;
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shimmer 1.5s infinite ease-in-out;
    flex-shrink: 0;
}

.skeleton-card-list .skeleton-info-list {
    flex-grow: 1;
    margin-right: 15px;
}

/* Autocomplete Styles */
.autocomplete-container {
    position: relative;
}

.autocomplete-items {
    position: absolute;
    border: 1px solid var(--border-color);
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.autocomplete-items div:hover {
    background-color: #333;
}

.autocomplete-active {
    background-color: var(--primary-blue) !important;
    color: #ffffff;
}

/* Real-time Validation */
#uploadSection input.input-invalid, #uploadSection select.input-invalid {
    border-left: 3px solid #ff4d4d;
}

#uploadSection input.input-valid, #uploadSection select.input-valid {
    border-left: 3px solid var(--accent-green);
}

.validation-message {
    font-size: 12px;
    color: #ff4d4d;
    margin-top: -4px;
    margin-bottom: 8px;
    text-align: right;
    display: none;
}

/* Book Type Selection Toggles */
.book-type-selection {
    margin-bottom: 1.25rem;
}

.book-type-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.book-type-toggles {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-color);
    padding: 0.375rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.book-type-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 7px;
}

.book-type-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.book-type-btn.active {
    color: var(--primary);
    background: rgba(212, 175, 55, 0.15);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.book-type-btn .material-icons {
    font-size: 1.1rem;
}

/* Conditional Fields */
.conditional-fields {
    margin-bottom: 1rem;
    animation: fadeInNew 0.3s ease-out;
}

.conditional-fields input {
    margin-bottom: 0.75rem;
}

/* Drag & Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg-color);
    position: relative;
    margin-bottom: 1rem;
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(212, 175, 55, 0.05);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.drop-zone-icon {
    font-size: 3rem;
    color: var(--text-dim);
    transition: all 0.3s ease;
}

.drop-zone.drag-over .drop-zone-icon {
    color: var(--primary);
    transform: scale(1.1);
}

.drop-zone-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);
    margin: 0;
}

.drop-zone-subtext {
    font-size: 0.875rem;
    color: var(--text-dim);
    margin: 0;
}

.drop-zone-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: var(--bg-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.drop-zone-button:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.drop-zone-button .material-icons {
    font-size: 1.25rem;
}

/* Drop Zone Preview */
.drop-zone-preview {
    position: relative;
    display: inline-block;
    animation: fadeInNew 0.3s ease-out;
}

.drop-zone-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: var(--shadow-card);
}

.drop-zone-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ff4d4d;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.drop-zone-remove:hover {
    background: #ff1a1a;
    transform: scale(1.1);
}

.drop-zone-remove .material-icons {
    font-size: 1.25rem;
}

/* Condition & Book Type Filter Checkbox Alignment */
.side-panel .condition-item-label,
.side-panel .book-type-filter-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px; /* Space between checkbox and text */
    padding: 2px 0;
}

.side-panel .condition-item-label input[type="checkbox"],
.side-panel .book-type-filter-label input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.side-panel .condition-item-label span,
.side-panel .book-type-filter-label span {
    flex-grow: 1;
    text-align: right;
    font-size: 14px;
}

/* Upload Book Modal */
.upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10002;
    animation: fadeIn 0.2s ease-out;
}

.upload-modal:not(.hidden) {
    display: flex;
}

.upload-modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

.upload-modal-content.large {
    max-width: 700px;
}

.upload-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.upload-modal-header h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 20px;
}

.upload-modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: 0.2s;
}

.upload-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

#contactSellerSection textarea {
    width: 100%;
    padding: 10px;
    margin-top: 15px;
    margin-bottom: 15px;
    background: #1e1e26;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: white;
    box-sizing: border-box;
    font-size: 14px;
    resize: vertical; /* Allow vertical resizing */
}

#contactSellerSection textarea:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Button to open upload modal */
.btn-open-upload {
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    margin-bottom: 15px;
    width: 100%;
    justify-content: center;
}

.btn-open-upload:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* No Results Message */
.no-results-message {
    text-align: center;
    color: var(--text-dim);
    font-size: 16px;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-top: 20px;
    border: 1px dashed var(--border-color);
}

/* My Area Stats */
.my-area-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .my-area-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .my-area-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: 0.2s;
    cursor: pointer;
}

.stat-card:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

.stat-card.active {
    background: var(--primary);
    border-color: var(--gold-dark);
    color: var(--bg-color);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.stat-card.active .stat-icon,
.stat-card.active .stat-value,
.stat-card.active .stat-label {
    color: var(--bg-color);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--primary);
    transition: color 0.2s;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 5px;
    transition: color 0.2s;
}

.stat-label {
    font-size: 13px;
    color: var(--text-dim);
    transition: color 0.2s;
}

.sales-history {
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-color);
    border-radius: 8px;
    padding: 10px;
}

.sale-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--card-bg);
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
}

.sale-item:hover {
    background: var(--secondary);
}

/* Personal Area styles */
.personal-area {
    padding: 20px 0;
    background: transparent;
    margin-bottom: 30px;
}

.personal-area-header {
    text-align: center;
    margin-bottom: 40px; /* Increased margin */
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.personal-area-header h2 {
    font-size: 28px;
    margin-bottom: 5px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.personal-area-header h2 .material-icons {
    font-size: 2rem;
    color: var(--primary);
}

.personal-area-header .text-dim {
    font-size: 16px;
}

/* Personal Area Tabs are now removed, but content panels remain */
/* Personal Area Tab Content */
.personal-area-tab-content {
    display: none;
    animation: fadeInNew 0.4s ease-out;
}

.personal-area-tab-content.active {
    display: block;
}

/* Specific adjustments for book list in personal area */
#myBooksList.books-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.personal-area .book-card {
    border-color: rgba(212, 175, 55, 0.3); /* Differentiate user's books */
}

/* Breadcrumbs Styles */
.breadcrumb-container {
    padding: 10px 0;
    margin-bottom: 15px;
}

.breadcrumb-container.hidden {
    display: none;
}

.breadcrumb {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 0;
    font-size: 14px;
    color: var(--text-dim);
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumbs {
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--text-dim);
}

.breadcrumb-link {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}

.breadcrumb-link:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

.breadcrumb-separator {
    margin: 0 8px;
}

.breadcrumb-current {
    color: var(--text-main);
    font-weight: bold;
}

/* Floating Action Button for Mobile */
.fab-upload-mobile {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 20px;
    left: 20px; /* Adjusted for RTL, will appear on the bottom left */
    width: 56px;
    height: 56px;
    background-color: var(--primary-blue);
    color: white;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.fab-upload-mobile:hover {
    transform: scale(1.05);
}

.hidden-on-mobile {
    display: flex; /* Or whatever its default display is */
}

@media (max-width: 800px) {
    .fab-upload-mobile {
        display: flex; /* Show FAB on mobile */
    }
    .hidden-on-mobile {
        display: none !important; /* Hide original button on mobile */
    }
}

/* --- Micro-interaction Animations --- */
/* Favorite button pulse */
@keyframes pulse-heart {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.pulsing {
    animation: pulse-heart 0.5s ease-in-out;
}

/* General button press feedback */
.btn:active, .btn-navbar-action:active, .fab-upload-mobile:active {
    transform: scale(0.96);
    opacity: 0.9;
}

/* Similar Books Section in Book Details Modal */
.similar-books-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.similar-books-section h4 {
    margin: 0 0 15px;
    color: var(--text-main);
    font-size: 18px;
    text-align: center;
}

.similar-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.similar-book-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
}

.similar-book-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.similar-book-img {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.similar-book-title {
    font-size: 13px;
    font-weight: bold;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    height: 2.6em; /* 2 lines * 1.3 line-height */
}

.similar-book-price {
    font-size: 12px;
    color: var(--accent-green);
    font-weight: bold;
    margin-top: 5px;
}

/* ============================================
   MODERN ANIMATIONS & EFFECTS
   ============================================ */

/* Floating Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Fade In Animation */
@keyframes fadeInNew {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse Glow Animation */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(251, 191, 36, 0.6);
    }
}

/* Scale Up on Hover */
@keyframes scaleUp {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.05);
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Gold Text Gradient */
.gold-text {
    background: linear-gradient(135deg, var(--gold-light), var(--primary-gold), var(--gold-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Gold Background Gradient */
.gradient-gold {
    background: linear-gradient(135deg, var(--gold-light), var(--primary-gold), var(--gold-dark));
}

/* Shadow Effects */
.shadow-glow {
    box-shadow: var(--shadow-glow);
}

.shadow-hover {
    transition: box-shadow 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: var(--shadow-hover);
}

.shadow-card {
    box-shadow: var(--shadow-card);
}

/* Animation Classes */
.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-shimmer {
    background: linear-gradient(
        90deg,
        var(--card-bg) 0%,
        var(--border-color) 50%,
        var(--card-bg) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

.animate-fadeIn {
    animation: fadeInNew 0.6s ease-out;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

/* Delay Classes for Staggered Animations */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

/* ============================================
   BADGES - Colorful Status Indicators
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-available {
    background: #22c55e; /* Green */
    color: #ffffff;
    border: none;
}

.badge-sold {
    background: #ef4444; /* Red */
    color: #ffffff;
    border: none;
}

.badge-digital {
    background: #3b82f6; /* Blue */
    color: #ffffff;
    border: none;
}

.badge-store {
    background: #8b5cf6; /* Violet */
    color: #ffffff;
    border: none;
}

.badge-secondhand {
    background: #f97316; /* Orange */
    color: #ffffff;
    border: none;
}

.badge-admin {
    background: #fbbf24; /* Amber */
    color: #1c1917;
    border: none;
}

.badge-user {
    background: #64748b; /* Slate */
    color: #ffffff;
    border: none;
}

/* Badge Icons */
.badge .material-icons {
    font-size: 0.875rem;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    animation: fadeInNew 0.6s ease-out;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-icon .material-icons {
    font-size: 4rem;
    color: var(--text-dim);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-weight: 600;
}

.empty-state p {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.empty-state .btn {
    width: auto;
    padding: 0.75rem 2rem;
}

/* ============================================
   GLASSMORPHISM EFFECTS
   ============================================ */

.glass-effect {
    background: rgba(26, 26, 36, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body[data-theme="light"] .glass-effect {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* ============================================
   IMPROVED HOVER EFFECTS
   ============================================ */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.hover-scale {
    transition: transform 0.7s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

/* ============================================
   MODERN TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-message {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-main);
}

.toast-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
    color: var(--text-dim);
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.toast-close .material-icons {
    font-size: 18px;
}

/* Toast Types */
.toast-success {
    border-right: 4px solid #4ade80;
}

.toast-success .toast-icon {
    color: #4ade80;
}

.toast-error {
    border-right: 4px solid #f87171;
}

.toast-error .toast-icon {
    color: #f87171;
}

.toast-warning {
    border-right: 4px solid #fbbf24;
}

.toast-warning .toast-icon {
    color: #fbbf24;
}

.toast-info {
    border-right: 4px solid var(--primary);
}

.toast-info .toast-icon {
    color: var(--primary);
}

/* Toast Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .toast-container {
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* ============================================
   ADMIN PANEL - Modern Design
   ============================================ */

.admin-panel {
    padding: 2rem;
    animation: fadeInNew 0.6s ease-out;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    grid-column: 1 / -1; /* Span all columns in the grid */
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.admin-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 2rem;
    margin: 0;
}

.admin-header .material-icons {
    color: var(--primary);
    font-size: 2rem;
}

/* Stats Grid */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInNew 0.6s ease-out;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-icon.green {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
}

.stat-icon.purple {
    background: rgba(167, 139, 250, 0.1);
    color: #a78bfa;
}

.stat-icon.gold {
    background: rgba(251, 191, 36, 0.1);
    color: var(--primary);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive {
    color: #4ade80;
}

.stat-change.negative {
    color: #f87171;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    overflow-x: auto;
}

.admin-tab {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.admin-tab.active {
    color: var(--primary);
}

.admin-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.admin-tab .material-icons {
    font-size: 1.25rem;
}

/* Tab Content */
.admin-tab-content {
    display: none;
    animation: fadeInNew 0.4s ease-out;
}

.admin-tab-content.active {
    display: block;
}

/* Main Page Tabs - Modern Glassmorphism */
.main-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    padding: 6px;
    background: rgba(26, 26, 36, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
}

.main-tabs::-webkit-scrollbar {
    display: none;
}

.main-tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.main-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.main-tab.active {
    color: #1a1a24;
    background: var(--primary);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

body[data-theme="light"] .main-tab.active {
    color: #fff;
}

.main-tab .material-icons {
    font-size: 20px;
}

/* No Results Container Styles */
.no-results-container {
    padding: 60px 20px;
    text-align: center;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin: 20px 0;
    animation: fadeIn 0.5s ease-out;
}

.no-results-content {
    max-width: 400px;
    margin: 0 auto;
}

.no-results-icon {
    font-size: 80px;
    color: var(--text-dim);
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results-container h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--text-main);
}

.no-results-container p {
    color: var(--text-dim);
    margin-bottom: 30px;
    line-height: 1.6;
}

.btn-secondary-outline {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary-outline:hover {
    background: var(--primary-blue);
    color: white;
}

/* Admin Section Card */
.admin-section-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
    height: fit-content;
}

/* Admin Content Grid - 2 columns layout for better use of space */
.admin-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-content-grid .admin-section-card {
    margin-bottom: 0;
}

/* Full width section */
.admin-section-full {
    grid-column: 1 / -1;
}

@media (max-width: 1200px) {
    .admin-content-grid {
        grid-template-columns: 1fr;
    }

    .admin-section-full {
        grid-column: 1;
    }
}

/* Inbox / Messages Styles */
.message-list-item {
    transition: background 0.2s, transform 0.1s;
}

.message-list-item:hover {
    transform: translateX(-2px);
}

.message-list-item:active {
    transform: translateX(0);
}

.admin-section-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-section-card h3 .material-icons {
    color: var(--primary);
}

/* Search Box in Admin */
.admin-search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.admin-search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    transition: all 0.2s;
}

.admin-search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

.admin-search-box .material-icons {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
}

/* Admin Tables */
.admin-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background: var(--secondary);
}

.admin-table th {
    text-align: right;
    padding: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.admin-table tbody tr {
    transition: background 0.2s;
}

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* Admin Action Buttons */
.admin-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.admin-action-btn {
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.admin-action-btn.delete {
    color: #f87171;
}

.admin-action-btn.delete:hover {
    background: rgba(248, 113, 113, 0.1);
}

.admin-action-btn.edit {
    color: var(--primary);
}

.admin-action-btn.edit:hover {
    background: rgba(251, 191, 36, 0.1);
}

.admin-action-btn .material-icons {
    font-size: 1.25rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .admin-panel {
        padding: 1rem;
    }

    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 2rem;
    }

    .admin-tabs {
        gap: 0.25rem;
    }

    .admin-tab {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .main-tabs {
        gap: 0.25rem;
        padding: 0.375rem;
    }

    .main-tab {
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
        flex: 1;
        min-width: fit-content;
    }

    .main-tab .material-icons {
        font-size: 1rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Admin Panel Actions Layout */
.admin-actions-container {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
    gap: 15px; /* Space between items */
    justify-content: flex-start; /* Align items to the start */
    margin-bottom: 20px;
}

/* Multi-image Upload Previews */
.drop-zone-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 1rem;
}

.image-preview-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.image-preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-wrapper .drop-zone-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
}

.image-preview-wrapper .drop-zone-remove .material-icons {
    font-size: 1rem;
}

/* Image Carousel in Book Details */
.image-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-carousel img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 24px;
    font-weight: bold;
    padding: 10px;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    user-select: none;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

.carousel-counter {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
}

/* For description pre-wrap */
.pre-wrap {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* For full-width detail item */
.detail-item.full-width {
    grid-column: 1 / -1; /* Span across all columns in a grid */
}

 / *   A d m i n   V i e w   L a y o u t   O v e r r i d e   * / 
 . m a i n - l a y o u t . a d m i n - v i e w - a c t i v e   { 
         d i s p l a y :   b l o c k ; 
 } 
  
 
/* --- Fixes for User Requests (Added via CLI) --- */

/* 2. Contact Seller Button Alignment */
.btn-contact-seller {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* 8. Favorites Checkbox Position (Fix overlap with badges) */
.favorite-btn {
    top: 45px;
    z-index: 20;
}

/* 8/12. Textarea Full Width */
textarea {
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

/* 14. Row View Images Size Reset (For external links) */
.books-list-view .book-img .btn-external-link {
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.books-list-view .book-img .btn-external-link span {
    font-size: 0; /* Hide text */
}

.books-list-view .book-img .btn-external-link .material-icons {
    font-size: 18px !important; /* Show icon only, properly sized */
    display: block;
}

/* 12. New Book Description Modal Layout */
.detail-item.full-width {
    grid-column: 1 / -1;
}

/* 13. Multiple Images Carousel Improvements */
.image-carousel {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    height: 100%;
    justify-content: center;
}

.image-carousel img {
    max-height: 400px;
    width: 100%;
    object-fit: contain;
}

.carousel-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    justify-content: center;
    width: 100%;
}

.carousel-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 2px solid transparent;
    cursor: pointer;
    border-radius: 4px;
    opacity: 0.6;
    transition: 0.2s;
    flex-shrink: 0;
}

.carousel-thumbnail.active {
    border-color: var(--primary);
    opacity: 1;
}

/* 12. Book Description Textarea in Upload Modal */
#description {
    min-height: 100px;
}


/* --- Forced Fixes (Important) --- */

/* Force Contact Seller Button Styling */
.btn-contact-seller {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    text-align: center !important;
}

/* Force Textarea Full Width and Size */
textarea, #managementMessage, #description {
    width: 100% !important;
    box-sizing: border-box !important;
    min-width: 100% !important;
    max-width: 100% !important;
}

/* Ensure Management Modal Content is Full Width */
#contactManagementModal .upload-modal-content {
    width: 90% !important;
    max-width: 600px !important;
}

/* Store/External Link Image Fix in List View */
.books-list-view .book-img .btn-external-link {
    width: 35px !important;
    height: 35px !important;
    padding: 0 !important;
    min-width: 0 !important;
}


/* --- Fixes Phase 3 --- */

/* Hide Logo Image in Dark Mode */
body:not([data-theme='light']) .logo img {
    display: none;
}

/* Fix Favorite Button in List View */
.books-list-view .book-card {
    position: relative;
    padding-left: 40px; /* Make space for favorite button */
}

.books-list-view .favorite-btn {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent; /* Cleaner look in list */
    width: 30px;
    height: 30px;
    border: none;
    box-shadow: none;
}

.books-list-view .favorite-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* --- Ken Burns Effect Hero Section --- */
.hero-container {
    width: 100%;
    height: 400px; /* גובה הבאנר */
    overflow: hidden; /* חובה! דואג שהתמונה לא תגלוש כשהיא גדלה */
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.hero-image {
    width: 100%;
    height: 100%;
    /* שימוש בתמונה המקומית שלך - Vintage B&W */
    background-image: url('hero-vintage.webp');
    background-size: cover;
    background-position: center;

    /* הגדרת האנימציה */
    animation: zoomEffect 20s linear infinite alternate;
}

/* אפקט כהה מעל התמונה */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(15,15,20,0.8));
    pointer-events: none;
}

/* הגדרת התנועה (זום עמוק ללא שוליים) */
@keyframes zoomEffect {
    0% {
        transform: scale(1.0); /* התחלה בגודל מלא - מונע שוליים */
    }
    100% {
        transform: scale(1.3); /* זום עמוק פנימה */
    }
}

/* =========================================
   Mobile Optimization & App Shell
   ========================================= */

/* Default: Hide Bottom Nav on Desktop */
.bottom-nav {
    display: none;
}

/* Global Reset for App Feel */
* {
    box-sizing: border-box; /* Critical for correct sizing */
    -webkit-tap-highlight-color: transparent; /* Remove blue tap highlight */
}

/* Mobile Styles - App Mode */
@media (max-width: 800px) {
    
    /* --- App Shell Structure --- */
    html, body {
        height: 100%;
        width: 100%;
        overflow: hidden; /* Prevent body scroll - App Feel */
        position: fixed; /* Lock the frame */
        margin: 0;
        padding: 0;
        background: var(--bg-color);
    }

    /* Fixed Top Navbar */
    .navbar {
        position: absolute; /* Absolute within fixed body */
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        height: calc(60px + env(safe-area-inset-top)); /* Handle notch */
        padding-top: env(safe-area-inset-top);
        padding-left: 15px;
        padding-right: 15px;
        background: var(--card-bg);
        border-bottom: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        justify-content: space-between;
        z-index: 1000;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    /* Fixed Bottom Navigation */
    .bottom-nav {
        display: flex;
        position: absolute; /* Absolute within fixed body */
        bottom: 0;
        left: 0;
        right: 0;
        height: 65px;
        height: calc(65px + env(safe-area-inset-bottom)); /* Handle home bar */
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--card-bg);
        border-top: 1px solid var(--border-color);
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    }

    /* Scrollable Content Area */
    .main-layout {
        position: absolute;
        top: calc(60px + env(safe-area-inset-top));
        bottom: calc(65px + env(safe-area-inset-bottom));
        left: 0;
        right: 0;
        overflow-y: auto; /* Scroll ONLY here */
        overflow-x: hidden; /* Prevent horizontal scroll */
        -webkit-overflow-scrolling: touch; /* Smooth scroll */
        padding: 10px;
        margin: 0;
        display: block; /* Override grid */
        width: 100%;
        gap: 0;
    }

    /* Scrollable Horizontal Tabs */
    .main-tabs {
        display: flex;
        overflow-x: auto; /* Allow horizontal scrolling */
        white-space: nowrap;
        -webkit-overflow-scrolling: touch; /* Smooth scroll */
        gap: 10px;
        padding-bottom: 5px; /* Space for scrollbar (hidden below) */
        margin-bottom: 15px;
        width: 100%; /* Force width constraint */
        scrollbar-width: none; /* Firefox: Hide scrollbar */
        -ms-overflow-style: none; /* IE: Hide scrollbar */
    }

    .main-tabs::-webkit-scrollbar {
        display: none; /* Chrome/Safari: Hide scrollbar */
    }

    .main-tab {
        flex: 1 0 auto; /* Allow growth, don't shrink */
        padding: 10px 20px; /* Wider touch area */
        font-size: 15px;
        border-radius: 12px; /* Slightly less rounded */
        border: 1px solid var(--border-color);
        background: var(--card-bg);
        text-align: center;
        min-width: fit-content;
    }
    
    .main-tab.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }

    .content-area {
        padding-bottom: 20px; /* Extra spacing at end */
        width: 100%;
        overflow: hidden;
    }

    /* --- UI Components Fixes --- */

    /* Navbar Flex Fixes */
    .navbar {
        justify-content: flex-start; /* Start from right (RTL) */
        gap: 10px;
    }
    
    .navbar .logo {
        flex: 0 1 auto; /* Allow shrinking */
        min-width: 0; /* Allow text truncation */
        margin-left: auto; /* Push icons to left */
    }

    .navbar .logo span {
        display: none !important; /* Hide text next to logo on mobile */
    }

    .content-area h2 {
        display: none !important; /* Hide main heading above books on mobile */
    }

    /* Container for icons */
    .navbar > div { 
        flex: 0 0 auto;
        display: flex;
        gap: 5px;
    }

    .navbar .logo img { 
        height: 54px !important; /* Maximize height within 60px navbar */
        width: auto; 
        flex-shrink: 0; 
        margin-top: 2px;
    }
    
    /* Nav Items */
    .nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-dim);
        background: none; border: none;
        height: 100%;
        padding: 8px 12px;
        min-height: 48px;
    }
    .nav-item .material-icons { font-size: 24px; margin-bottom: 2px; }
    .nav-item span { font-size: 10px; font-weight: 500; }
    .nav-item.active { color: var(--primary); }

    /* Center Action Button (Upload) */
    .nav-item.center-highlight {
        background: var(--primary);
        color: var(--bg-color);
        width: 50px; height: 50px;
        border-radius: 50%;
        position: absolute;
        bottom: calc(25px + env(safe-area-inset-bottom));
        left: 50%;
        transform: translateX(-50%);
        box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
        border: 4px solid var(--bg-color);
        z-index: 1001;
        display: flex; align-items: center; justify-content: center;
        padding: 0;
    }
    .nav-item.center-highlight .material-icons { font-size: 28px; margin: 0; }
    .nav-item.center-highlight span { display: none; }

    /* Hide Desktop Elements */
    #btnFavoritesPage, #btnMyAreaPage, #btnMyBooksPage, 
    #btnToggleSidePanel, .fab-upload-mobile, #userHeader,
    .navbar .btn-navbar-action span:not(.material-icons):not(.messages-badge),
    .view-switcher { /* HIDE VIEW SWITCHER ON MOBILE */
        display: none !important; 
    }

    /* Restore and resize Hero for Mobile */
    .hero-container {
        display: block !important;
        height: 150px; /* Much smaller height for mobile */
        border-bottom: 1px solid var(--border-color);
    }

    .navbar .btn-navbar-action {
        padding: 8px;
        border: none;
        min-width: 48px;
        min-height: 48px;
    }

    /* Hide Digital Tab on Mobile */
    .main-tab[data-filter="digital"] {
        display: none !important;
    }

    /* Light Mode Header Fix for Mobile */
    body[data-theme="light"] .navbar .logo img {
        height: 52px !important; /* Adjusted for light mode */
    }

    /* Full Screen Side Panel (Search) */
    .side-panel {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100%; height: 100%;
        z-index: 20000;
        background: var(--bg-color);
        padding: 20px;
        padding-top: calc(20px + env(safe-area-inset-top)); /* Safe area */
        overflow-y: auto;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
        border: none; margin: 0; border-radius: 0;
    }
    .side-panel.side-panel-open { transform: translateY(0); }

    .btn-close-panel-mobile {
        display: block; width: 100%;
        text-align: left; padding: 10px 0;
        background: none; border: none;
        border-bottom: 1px solid var(--border-color);
        font-weight: bold; color: var(--text-dim);
        font-size: 18px; margin-bottom: 20px;
    }

    .side-panel input, .side-panel select, .side-panel button {
        height: 50px; font-size: 16px; border-radius: 8px;
    }

    /* Grid Layout - 3 COLUMNS (Compact) */
    .books-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr) !important; /* 3 Columns */
        gap: 6px !important; /* Smaller gap */
        width: 100%;
    }

    .book-card {
        width: 100%; margin: 0;
        border-radius: 6px; /* Slightly smaller radius */
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    }

    .book-card .book-img { 
        height: 110px; /* Shorter image */
    }
    
    .book-info { 
        padding: 6px; /* Compact padding */
    }
    
    .book-title { 
        font-size: 11px; /* Smaller font */
        margin-bottom: 2px; 
        height: 28px; /* Strict height limit */
        line-height: 1.3;
        overflow: hidden; 
    }
    
    .book-author { 
        display: none; /* Hide author on grid to save space */
    }
    
    .book-price { 
        font-size: 13px; 
        margin-top: 2px; 
    }

    /* Shrink Badges on Mobile */
    .book-badges {
        top: 4px !important;
        right: 4px !important;
        left: 4px !important;
        gap: 2px !important;
        flex-direction: column !important; /* Stack vertically to fit narrow card */
        align-items: flex-end !important; /* Align to the side */
    }

    .badge {
        padding: 1px 4px !important;
        font-size: 8px !important;
        border-radius: 4px !important;
        gap: 2px !important;
        width: fit-content;
    }

    .badge .material-icons {
        font-size: 9px !important;
    }

    /* Shrink Favorite Button on Mobile */
    .favorite-btn {
        top: 4px !important;
        left: 4px !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
    }

    .favorite-btn .material-icons {
        font-size: 20px !important;
    }

    /* Modal Fixes */
    .upload-modal-content {
        width: 100% !important; height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        padding: 20px !important;
        padding-top: env(safe-area-inset-top) !important;
    }
}



/* App Mode Styles - Simplified Search */
body.app-mode .side-panel > div:not(:first-child):not(.app-search-container) {
    display: none !important;
}

body.app-mode .side-panel hr {
    display: none;
}

body.app-mode .side-panel h3 {
    margin-bottom: 15px;
}

/* Hide specific inputs in app mode except the main search */
body.app-mode #searchLocation,
body.app-mode #minPrice,
body.app-mode #maxPrice,
body.app-mode label[for='minPrice'],
body.app-mode label[for='maxPrice'],
body.app-mode label:has(input[type='checkbox']),
body.app-mode select {
    display: none !important;
}

body.app-mode .app-advanced-search-link {
    display: block;
    margin-top: 20px;
    text-align: center;
    color: var(--primary-blue);
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
}

body.app-mode #btnSearchApp {
    display: block;
    width: 100%;
    padding: 10px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 6px;
    margin-top: 10px;
    font-weight: bold;
}


/* --- Category Chips (Horizontal Scroll) --- */
.category-chips-container {
    display: flex;
    flex-wrap: nowrap; /* Back to one row */
    overflow-x: auto;
    gap: 6px;
    padding: 10px 8px;
    margin-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    -webkit-overflow-scrolling: touch;
}

.category-chips-container::-webkit-scrollbar {
    height: 6px;
}

.category-chips-container::-webkit-scrollbar-track {
    background: transparent;
}

.category-chips-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.category-chip {
    display: flex;
    flex-direction: column; /* Icon above text */
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 6px 4px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-dim);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    width: 58px; /* Narrower width */
    height: 52px; /* Shorter height */
    white-space: normal; /* Allow text wrapping */
    text-align: center;
    line-height: 1.1;
}

#resetFilters {
    background: none !important;
    border: 1px solid #ff4d4d !important;
    color: #ff4d4d !important;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: bold;
}

#resetFilters:hover {
    background: #ff4d4d !important;
    color: white !important;
}

.category-chip .material-icons {
    font-size: 14px; /* Smaller icons */
    opacity: 0.7;
}

.category-chip:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-dim);
    color: var(--text-main);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.category-chip.active {
    background: var(--primary);
    color: #1a1a24; /* Dark text for contrast on Gold */
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3); /* Gold glow */
}

.category-chip.active .material-icons {
    opacity: 1;
}

/* Support for custom background colors */
.category-chip[style*="background"] {
    font-weight: 500;
}

.category-chip.active[style*="background"] {
    opacity: 0.95;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: scale(1.05);
}

.category-chip[style*="background"]:hover {
    opacity: 0.9;
    filter: brightness(1.1);
}

/* Emphasized Categories (Special) */
.category-chip.special {
    border-color: var(--primary-blue);
    background: rgba(52, 152, 219, 0.05);
    color: var(--text-main);
    font-weight: 500;
}

.category-chip.special .material-icons {
    color: var(--primary-blue);
    opacity: 1;
}

/* Adjust for light theme if needed */
body[data-theme='light'] .category-chip.active {
    color: white; /* Often better on light theme if primary is dark, but primary is gold... check constrast */
    /* If primary is gold (hsl(45, 75%, 50%)), black text is better. */
    color: #000;
}


/* --- Price Display Enhancements --- */
.book-price-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.book-price-original {
    color: var(--text-dim);
    text-decoration: line-through;
    font-size: 0.9em;
    opacity: 0.7;
}

.book-price {
    color: var(--primary);
    font-weight: bold;
    font-size: 1.1em;
}

.books-list-view .book-price-container {
    margin-top: 0;
}


/* Hide validation message text */
.validation-message {
    display: none !important;
}



/* Filters Count Badge */
.filters-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #f97316;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
}


/* ========================================
   Accessibility - Reduced Motion Support
   ======================================== */

/* Respect user's motion preferences for accessibility.
   This ensures the site is usable for people with:
   - Vestibular disorders (balance/motion sensitivity)
   - Motion sickness
   - Epilepsy
   - ADHD or Autism (motion can be distracting)
   - Migraines triggered by motion */

@media (prefers-reduced-motion: reduce) {
    /* Disable Ken Burns effect on hero image */
    .hero-image {
        animation: none !important;
    }

    /* Disable zoom and transform effects */
    @keyframes zoomEffect {
        0%, 100% {
            transform: scale(1.0);
        }
    }

    /* Disable all keyframe animations and reduce transitions */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Keep spinners for loading states (they indicate progress, not decoration) */
    .spinner,
    .spinner-small {
        animation: spin 0.8s linear infinite !important;
    }

    /* Disable hover effects with transforms */
    .book-card:hover,
    .btn-open-upload:hover,
    .similar-book-card:hover,
    .stat-card:hover,
    .hover-lift:hover,
    .hover-scale:hover,
    .category-chip:hover,
    .carousel-thumbnail:hover {
        transform: none !important;
    }

    /* Ensure content is immediately visible */
    .book-card,
    .dialog-overlay,
    .sidebar,
    .modal,
    .toast,
    .admin-panel,
    .empty-state,
    .stat-card {
        opacity: 1 !important;
        transform: none !important;
    }

    /* Disable floating animation */
    .animate-float {
        animation: none !important;
    }

    /* Disable shimmer effect */
    .animate-shimmer {
        animation: none !important;
    }

    /* Keep fade-in minimal for content appearance */
    .animate-fadeIn,
    .fadeInNew {
        animation: none !important;
        opacity: 1 !important;
    }
}


/* ========================================
   Accessibility - Focus Indicators
   WCAG 2.1 Success Criterion 2.4.7 Level AA
   ======================================== */

/* Remove default browser outline (we're replacing it with better styling) */
*:focus {
    outline: none;
}

/* Universal focus style for interactive elements using keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Enhanced focus for buttons with shadow glow */
button:focus-visible,
.btn:focus-visible,
.btn-navbar-action:focus-visible,
.btn-primary:focus-visible,
.btn-toggle-filters:focus-visible,
.fab-upload-mobile:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Focus for links with rounded corners */
a:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Focus for form inputs */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 0px;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Focus for book cards (clickable) */
.book-card:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15), 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Focus for tabs */
.main-tab:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Focus for bottom navigation items */
.nav-item:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: -3px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Focus for carousel thumbnails */
.carousel-thumbnail:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
    transform: scale(1.05);
}

/* Focus for favorite button */
.favorite-btn:focus-visible,
.favorite-btn-large:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
    transform: scale(1.15);
}

/* Focus for category chips */
.category-chip:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Focus for template items (description templates menu) */
.template-item:focus-visible {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
    background: var(--primary-blue);
    color: white;
}

/* Light mode adjustment - darker blue for better contrast */
body[data-theme="light"] *:focus-visible {
    outline-color: #2563eb;
}

body[data-theme="light"] button:focus-visible,
body[data-theme="light"] .btn:focus-visible,
body[data-theme="light"] input:focus-visible,
body[data-theme="light"] select:focus-visible,
body[data-theme="light"] .main-tab:focus-visible,
body[data-theme="light"] .book-card:focus-visible {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

/* Reduced motion support - disable transform animations on focus */
@media (prefers-reduced-motion: reduce) {
    .book-card:focus-visible,
    .carousel-thumbnail:focus-visible,
    .favorite-btn:focus-visible {
        transform: none !important;
    }
}


/* ========================================
   Accessibility - Skip to Content Link
   WCAG 2.1 Success Criterion 2.4.1 Level A
   ======================================== */

/* Skip to Content Link - Hidden by default, appears on focus */
.skip-to-content {
    position: absolute;
    top: -100px; /* Hidden above the viewport */
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-blue);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    z-index: 10000; /* Above everything */
    transition: top 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    white-space: nowrap;
}

/* Appears when focused (keyboard Tab navigation) */
.skip-to-content:focus {
    top: 10px; /* Slide down to visible position */
    outline: 3px solid white;
    outline-offset: 2px;
}

/* Smooth scroll to target */
html {
    scroll-behavior: smooth;
}

/* Light mode adjustment */
body[data-theme="light"] .skip-to-content {
    background: #2563eb;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Reduced motion support - instant appearance instead of animation */
@media (prefers-reduced-motion: reduce) {
    .skip-to-content {
        transition: none;
    }

    html {
        scroll-behavior: auto;
    }
}


/* ========================================
   Accessibility - Screen Reader Only
   ======================================== */

/* Screen Reader Only - visible only to screen readers, hidden visually */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focusable version - becomes visible when focused (for skip links, etc) */
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}


/* ========================================
   Tags System
   ======================================== */

.tags-section {
    margin-top: 20px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.tags-section h4 {
    margin: 0 0 10px 0;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
}

.tags-display {
    min-height: 30px;
}

.book-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-blue);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.btn-add-tag {
    transition: all 0.2s ease;
}

.btn-add-tag:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

/* Pending tags admin panel */
.pending-tags-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pending-tag-item {
    padding: 15px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pending-tag-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.pending-tag-info {
    flex: 1;
}

.pending-tag-book-title {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.pending-tag-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #f39c12;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 6px;
}

.pending-tag-meta {
    font-size: 12px;
    color: var(--text-dim);
}

.pending-tag-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pending-tag-actions button {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.pending-tag-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.pending-tag-actions button.btn-approve {
    background: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
}

.pending-tag-actions button.btn-reject {
    background: #d32f2f;
    color: white;
    border-color: #d32f2f;
}

.pending-tag-actions button.btn-edit {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}


/* ========================================
   Improved Tags Admin Panel
   ======================================== */

.pending-book-group {
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.book-group-header {
    background: var(--card-bg);
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.book-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.book-group-title .book-title {
    font-weight: 600;
    color: var(--text-main);
    font-size: 15px;
}

.book-type-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.book-type-badge.google {
    background: #4285f4;
    color: white;
}

.book-type-badge.local {
    background: var(--accent-green);
    color: white;
}

.tag-count {
    font-size: 12px;
    color: var(--text-dim);
    background: rgba(255,255,255,0.05);
    padding: 3px 8px;
    border-radius: 12px;
}

.book-group-actions {
    display: flex;
    gap: 8px;
}

.book-group-actions button {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-main);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.book-group-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.book-group-actions .btn-approve-book {
    background: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
}

.book-group-actions .btn-reject-book {
    background: #d32f2f;
    color: white;
    border-color: #d32f2f;
}

.tags-list {
    padding: 10px;
    background: var(--bg-color);
}

.tag-item-row {
    display: grid;
    grid-template-columns: 30px 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.tag-item-row:hover {
    background: rgba(255,255,255,0.03);
}

.tag-value {
    font-weight: 500;
    color: var(--text-main);
    font-size: 14px;
}

.tag-submitter {
    font-size: 12px;
    color: var(--text-dim);
}

.tag-item-actions {
    display: flex;
    gap: 4px;
}

.tag-item-actions button {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tag-item-actions button:hover {
    transform: scale(1.1);
}

.tag-item-actions .btn-approve-single {
    background: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
}

.tag-item-actions .btn-reject-single {
    background: #d32f2f;
    color: white;
    border-color: #d32f2f;
}

.tag-item-actions .btn-edit-single {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.tag-item-actions .material-icons {
    font-size: 18px;
}

.bulk-actions-bar button.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Footer Styles */
.site-footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

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

.site-footer p {
    color: var(--text-dim);
    font-size: 12px;
    margin: 0;
}

