/* ============================================
   حميز كتب - ستايلات لوحة الإدارة
   ============================================ */

/* استيراد خط القاهرة من Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

/* إعادة تعريف بعض المتغيرات للوضع النهاري في لوحة الإدارة إذا لزم الأمر */
body.light-mode {
    /* يمكن تعديل الألوان هنا لتناسب لوحة الإدارة في الوضع النهاري */
    /* على سبيل المثال: */
    /* --background-card: #f8f9fa; */
    /* --text: #333; */
}

/* ===============================
   إعدادات عامة للوحة الإدارة
   =============================== */
body {
    font-family: 'Cairo', sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    direction: rtl; /* لضمان الاتجاه من اليمين لليسار */
    text-align: right; /* محاذاة النص لليمين */
}

/* خلفية متحركة */
body::before {
    opacity: 0.1; /* تقليل شدة الخلفية المتحركة في لوحة الإدارة */
}

.admin-panel {
    display: none; /* مخفي افتراضياً حتى يتم تسجيل الدخول */
    padding: 2rem; /* Adjusted padding to be consistent */
    position: relative; /* Ensure it creates a stacking context */
    z-index: 1; /* Default stacking context */
    min-height: calc(100vh - var(--header-height, 70px) - 4rem); /* Ensure it fills vertical space */
    box-sizing: border-box; /* Include padding in height calculation */
    max-width: 1400px; /* Limit width */
    margin: 0 auto; /* Center the panel */
}
.admin-panel.active {
    display: block;
}

/* ===============================
   صفحة تسجيل الدخول
   =============================== */
.login-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-xl);
    padding: 3rem;
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 450px;
    text-align: center;
}

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

.login-header h2 {
    font-size: var(--font-size-3xl);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

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

.login-warning {
    background-color: rgba(245, 158, 11, 0.15); /* Light orange background */
    border-left: 5px solid var(--warning); /* Orange left border */
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    color: var(--warning);
    text-align: right;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.login-warning i {
    font-size: 1.5rem;
    color: var(--warning);
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.login-warning p {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--text-light); /* Make text readable in dark mode */
}

.login-warning strong {
    color: var(--accent); /* Highlight "هام" */
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: right;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-family: inherit;
    font-size: var(--font-size-base);
    transition: all var(--transition);
}

.form-group input[type="file"] {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    color: var(--text-muted);
    cursor: pointer;
}
.form-group input[type="file"]::file-selector-button {
    background: var(--primary-dark);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    margin-left: 1rem;
    cursor: pointer;
    transition: background var(--transition);
}
.form-group input[type="file"]::file-selector-button:hover {
    background: var(--primary);
}


.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    font-size: var(--font-size-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===============================
   لوحة الإدارة الرئيسية
   =============================== */
.admin-panel {
    display: none; /* مخفي افتراضياً حتى يتم تسجيل الدخول */
    padding-top: 2rem;
}

.admin-panel.active {
    display: block;
}

/* الهيدر */
.admin-header {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.admin-header-content h1 {
    font-size: var(--font-size-3xl);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.admin-header-content h1 i {
    -webkit-text-fill-color: var(--accent);
    font-size: 0.8em;
}

.admin-header-content p {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.admin-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
}
.btn-secondary:hover {
    background: var(--secondary-dark);
    box-shadow: var(--shadow-secondary);
}

.logout-btn {
    background: var(--danger);
    color: white;
    padding: 0.75rem 1.5rem;
}
.logout-btn:hover {
    background: var(--danger-dark);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* ===============================
   الإحصائيات
   =============================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0; /* Changed to right for RTL */
    width: 3px;
    height: 100%;
    background: var(--primary-gradient);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform var(--transition);
}
.stat-card:hover::before {
    transform: scaleY(1);
}


.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-number {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* ===============================
   البحث والفلاتر
   =============================== */
.search-filter-section {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem; /* Adjust padding for icon on left */
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-family: inherit;
    font-size: var(--font-size-base);
    transition: all var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.2);
}

.search-box i {
    position: absolute;
    left: 1rem; /* Changed to left for RTL */
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: flex-end; /* Align buttons to bottom */
}

/* ===============================
   قائمة الكتب
   =============================== */
.books-list-section {
    margin-bottom: 2rem;
}

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

.book-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: all var(--transition);
    border-right: 4px solid var(--primary); /* Highlight on right */
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.book-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(-5px);
}

.book-item.draft {
    border-right-color: var(--warning);
    background: rgba(245, 158, 11, 0.05);
}

.book-item-cover {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
    flex-shrink: 0;
}

.book-details {
    flex-grow: 1;
    min-width: 200px;
}

.book-title-admin {
    font-size: var(--font-size-xl);
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.book-meta-admin {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.book-meta-admin span i {
    margin-left: 0.5rem;
    color: var(--primary);
}

.book-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.badge-published {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.badge-draft {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.badge-free {
    background: rgba(0, 166, 81, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}
.badge-partial {
    background: rgba(14, 165, 233, 0.2);
    color: var(--info);
    border: 1px solid var(--info);
}
.badge-paid {
    background: rgba(255, 215, 0, 0.2);
    color: var(--accent);
    border: 1px solid var(--accent);
}


.book-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-left: auto; /* Push actions to the left */
}

.btn-edit {
    background: var(--info);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
}
.btn-edit:hover {
    background: var(--info-dark);
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

.btn-delete {
    background: var(--danger);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
}
.btn-delete:hover {
    background: var(--danger-dark);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.no-books {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}
.no-books i {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--border-lighter);
}

/* ===============================
   قسم إضافة/تعديل كتاب
   =============================== */
.add-edit-book-section {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    display: none; /* مخفي افتراضياً */
    /* Added for robustness */
    position: relative; 
    z-index: 2; 
    min-height: calc(100vh - var(--header-height, 70px) - 4rem); /* Fill vertical space, accounting for header and footer padding */
    width: 100%; 
    box-sizing: border-box; 
    margin: 0 auto; 
    max-width: 1400px; 
}

.add-edit-book-section.active {
    display: block !important; /* Force display to block */
    animation: fadeInDown 0.5s ease;
    padding-top: 2rem; /* Ensure content is not hidden by sticky header or other elements */
}

.section-title {
    font-size: var(--font-size-2xl);
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.section-title i {
    -webkit-text-fill-color: var(--accent);
    font-size: 0.8em;
}

.section-subtitle {
    font-size: var(--font-size-xl);
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.section-subtitle i {
    color: var(--info);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group .required {
    color: var(--danger);
    margin-right: 0.2rem;
}

/* غلاف الكتاب */
.cover-preview {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Align to right */
    gap: 0.75rem;
}
.cover-preview img {
    max-width: 150px;
    height: auto;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-light);
}
.cover-preview .btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
}

.section-divider {
    border: none;
    border-top: 1px dashed var(--border-light);
    margin: 2.5rem 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end; /* Align buttons to the right */
    margin-top: 2rem;
}

/* ===============================
   قسم إدارة الصفحات
   =============================== */
#pagesManagementSection {
    margin-top: 3rem;
    border-top: 1px solid var(--border-light);
    padding-top: 2rem;
}

.pages-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: flex-start; /* Align to right for RTL */
}

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

.page-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all var(--transition);
    border-right: 4px solid var(--info);
}
.page-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(-5px);
}

.page-item.locked {
    border-right-color: var(--warning);
    background: rgba(245, 158, 11, 0.05);
}

.page-number {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--secondary);
    flex-shrink: 0;
    width: 50px;
    text-align: center;
}
.page-item.locked .page-number {
    color: var(--warning);
}

.page-content-preview {
    flex-grow: 1;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 250px); /* Adjust based on other elements */
}
.page-content-preview strong {
    color: var(--text-light);
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.btn-page-edit,
.btn-page-delete {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-page-edit {
    background: var(--info);
    color: white;
}
.btn-page-edit:hover {
    background: var(--info-dark);
}
.btn-page-delete {
    background: var(--danger);
    color: white;
}
.btn-page-delete:hover {
    background: var(--danger-dark);
}

.no-pages {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}
.no-pages i {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--border-lighter);
}

/* TinyMCE Editor Customization */
.tox-tinymce {
    border-radius: var(--border-radius) !important;
    border: 2px solid var(--border-light) !important;
    overflow: hidden;
    margin-top: 1rem;
}
.tox-editor-container {
    background: rgba(255, 255, 255, 0.05) !important;
}
.tox-toolbar-overlord,
.tox-statusbar {
    background: var(--background-elevated) !important;
    border-color: var(--border) !important;
}
.tox-editor-header {
    background: var(--background-elevated) !important;
    border-bottom: 1px solid var(--border) !important;
}
.tox-menubar,
.tox-toolbar__primary,
.tox-toolbar__group {
    background: var(--background-elevated) !important;
    border-color: var(--border) !important;
}
.tox .tox-tbtn,
.tox .tox-mbtn {
    color: var(--text-light) !important;
}
.tox .tox-tbtn:hover,
.tox .tox-mbtn:hover {
    background: rgba(0, 166, 81, 0.1) !important;
    color: var(--primary) !important;
}
.tox .tox-tbtn--enabled,
.tox .tox-mbtn--active {
    background: rgba(0, 166, 81, 0.2) !important;
    color: var(--primary) !important;
}
.tox-collection__item--active {
    background: rgba(0, 166, 81, 0.2) !important;
    color: var(--primary) !important;
}
.tox-edit-area__iframe {
    background-color: var(--background-card) !important;
    color: var(--text) !important;
}
.tox-edit-area__iframe body {
    color: var(--text) !important;
}
.tox-dialog {
    background: var(--background-card) !important;
    color: var(--text) !important;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}
.tox-dialog__header,
.tox-dialog__footer {
    background: var(--background-elevated) !important;
    border-color: var(--border) !important;
}
.tox-dialog__title {
    color: var(--primary) !important;
}
.tox-label {
    color: var(--text-light) !important;
}
.tox-textfield,
.tox-select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-light) !important;
    color: var(--text) !important;
}
.tox-button {
    background: var(--primary) !important;
    color: white !important;
    border-radius: var(--border-radius-sm) !important;
}
.tox-button:hover {
    background: var(--primary-light) !important;
}

/* Modal for Add Pages from Text and Add/Edit Page */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.show {
    visibility: visible;
    opacity: 1;
}
.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 700px;
    box-shadow: var(--shadow-xl);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* Limit height */
    overflow-y: auto; /* Enable scroll if content is too long */
}
.modal-overlay.show .modal-content {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1rem;
    flex-shrink: 0;
}
.modal-header h3 {
    margin: 0;
    color: var(--primary);
    font-size: var(--font-size-2xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.modal-header h3 i {
    color: var(--accent);
}
.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: var(--font-size-xl);
    cursor: pointer;
    transition: color var(--transition);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close-btn:hover {
    color: var(--danger);
    background-color: rgba(255, 0, 0, 0.1);
}
.modal-body {
    flex-grow: 1;
    overflow-y: auto; /* Allow body content to scroll */
    padding-top: 0.5rem;
    padding-bottom: 1rem;
}
.modal-body .form-group textarea {
    min-height: 200px; /* Adjusted min-height */
}
.modal-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    flex-shrink: 0;
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
}

.modal-description {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-panel {
        padding: 1.5rem;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    .book-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .book-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
    .page-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .page-content-preview {
        max-width: 100%;
    }
    .page-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
    .pages-toolbar {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .admin-panel {
        padding: 1rem;
    }
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .admin-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .admin-actions .btn {
        flex: 1;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .filters-row {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .login-card {
        padding: 2rem;
    }
    .modal-content {
        padding: 1.5rem;
        max-width: 95%;
    }
    .modal-header h3 {
        font-size: var(--font-size-xl);
    }
    .modal-footer {
        flex-direction: column;
    }
    .modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .admin-header-content h1 {
        font-size: var(--font-size-2xl);
    }
    .btn {
        padding: 0.75rem 1rem;
        font-size: var(--font-size-sm);
    }
    .stat-number {
        font-size: var(--font-size-3xl);
    }
    .book-title-admin {
        font-size: var(--font-size-lg);
    }
    .book-item-cover {
        width: 60px;
        height: 80px;
    }
    .page-number {
        font-size: var(--font-size-xl);
        width: 40px;
    }
    .modal-content {
        padding: 1rem;
    }
}