/* Reset ve Temel Stiller */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    font-weight: 400;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* CSS Variables for Theme - Black & White Only */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f8f8;
    --bg-tertiary: #f0f0f0;
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-tertiary: #666666;
    --accent-primary: #000000;
    --accent-secondary: #333333;
    --border-color: #e0e0e0;
    --shadow-light: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-medium: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-heavy: 0 4px 16px rgba(0,0,0,0.1);
}

/* Dark Theme Variables - Black & White Only */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-tertiary: #999999;
    --accent-primary: #ffffff;
    --accent-secondary: #cccccc;
    --border-color: #333333;
    --shadow-light: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-medium: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-heavy: 0 4px 16px rgba(0,0,0,0.3);
}

/* Admin Container */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar - Enhanced */
.sidebar {
    width: 280px;
    background: var(--bg-primary);
    color: var(--text-primary);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 20px rgba(0,0,0,0.08);
    border-right: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--bg-secondary);
}

.sidebar-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-header h2::before {
    content: "⚡";
    font-size: 1.4rem;
}

.sidebar-header i {
    margin-right: 0.5rem;
    color: var(--accent-primary);
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.theme-toggle:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: scale(1.1);
}

.sidebar-nav ul {
    list-style: none;
    padding: 1.5rem 0;
}

.sidebar-nav li {
    margin: 0.25rem 0.75rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sidebar-nav a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--accent-primary);
    transform: scaleY(0);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-nav a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    opacity: 0.8;
    transition: all 0.25s ease;
}

.sidebar-nav a:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateX(4px);
}

.sidebar-nav a:hover i {
    opacity: 1;
    transform: scale(1.1);
}

.sidebar-nav a.active {
    background-color: var(--bg-tertiary);
    color: var(--accent-primary);
    font-weight: 600;
}

.sidebar-nav a.active::before {
    transform: scaleY(1);
}

.sidebar-nav a.active i {
    opacity: 1;
}

/* Main Content - Admin */
.admin-container .main-content {
    flex: 1;
    margin-left: 280px;
    background-color: var(--bg-secondary);
    min-height: 100vh;
}

/* Main Content - Public */
.public-container .main-content {
    flex: 1;
    background-color: var(--bg-primary);
}

.main-header {
    background: var(--bg-primary);
    padding: 2rem 2.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.main-header h1 {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.date {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date::before {
    content: "📅";
    font-size: 1rem;
}

/* Dashboard */
.dashboard {
    padding: 2rem;
}

/* İstatistik Kartları */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-primary);
    padding: 1.75rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--text-tertiary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, var(--accent-primary), var(--text-secondary));
    color: var(--bg-primary);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, var(--text-secondary), var(--text-tertiary));
    color: var(--bg-primary);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, var(--text-tertiary), var(--accent-secondary));
    color: var(--bg-primary);
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    color: var(--bg-primary);
}

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Bölüm Başlıkları */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 500;
}

/* Butonlar - Minimal */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.85rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-info {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-danger {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Kitap Kartları - Minimal */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.book-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

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

.book-cover {
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.book-cover img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.no-cover {
    font-size: 1.5rem;
    color: var(--text-tertiary);
}

.book-info {
    padding: 0.75rem;
}

.book-info h3 {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.book-info .description {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.book-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

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

/* Form Stilleri - Minimal */
.form-container {
    background: var(--bg-primary);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    max-width: 800px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    font-weight: 400;
    font-size: 0.85rem;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

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

.form-control[readonly] {
    background-color: var(--bg-tertiary) !important;
    cursor: not-allowed !important;
    color: var(--text-secondary) !important;
}

.username-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Custom Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.checkbox-label:hover .checkmark {
    border-color: var(--accent-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid var(--bg-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.file-upload {
    position: relative;
    display: inline-block;
    cursor: pointer;
    width: 100%;
}

.file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed #ccc;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.file-upload:hover .file-upload-label {
    border-color: #667eea;
    background: #f0f2ff;
}

/* Tablo Stilleri - Minimal */
.table-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

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

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

.table th {
    background: var(--bg-tertiary);
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

/* Alert Mesajları - Minimal */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.alert-success {
    border-color: var(--accent-primary);
    background: var(--bg-primary);
}

.alert-error {
    border-color: #dc3545;
    background: var(--bg-primary);
    color: #dc3545;
}

.alert-info {
    border-color: var(--accent-primary);
    background: var(--bg-primary);
}

/* Login Sayfası - Minimal */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
}

.login-box {
    background: var(--bg-primary);
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 100%;
    max-width: 350px;
}

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

.login-header h1 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Mobile Hamburger Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: var(--bg-tertiary);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

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

/* Responsive Tasarım - Enhanced Mobile */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
        width: 280px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .admin-container .main-content {
        margin-left: 0;
    }
    
    .main-header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .main-header h1 {
        font-size: 1.4rem;
    }
    
    .dashboard {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.1rem;
    }
    
    /* Mobile Table Responsiveness */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 600px;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    /* Mobile Form Improvements */
    .form-container {
        padding: 1rem;
        margin: 0 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        padding: 0.75rem;
        font-size: 1rem; /* Prevent zoom on iOS */
    }
    
    textarea.form-control {
        min-height: 120px;
    }
    
    /* Mobile Button Improvements */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        min-height: 44px; /* Touch-friendly */
    }
    
    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-height: 36px;
    }
    
    .book-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .book-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile Header Actions */
    .header-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .date {
        order: -1;
        width: 100%;
        text-align: center;
    }
    
    /* Mobile-specific improvements */
    .login-box {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .search-box {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Touch-friendly navigation */
    .sidebar-nav a {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Better mobile typography */
    body {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Mobile-optimized cards */
    .book-card {
        margin-bottom: 1rem;
    }
    
    .book-cover {
        height: auto;
    }
    
    .book-cover img {
        height: auto;
        object-fit: contain;
    }
    
    .book-info {
        padding: 1rem;
    }
    
    /* Mobile modal improvements */
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    /* Improved touch targets */
    .theme-toggle {
        width: 48px;
        height: 48px;
    }
    
    /* Mobile table alternative */
    .mobile-card-view {
        display: block;
    }
    
    .mobile-card-view .table {
        display: none;
    }
    
    .mobile-item {
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .mobile-item-header {
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 0.5rem;
    }
    
    .mobile-item-content {
        color: var(--text-secondary);
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .mobile-item-actions {
        margin-top: 1rem;
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
}

/* Additional mobile improvements for very small screens */
@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .dashboard {
        padding: 0.5rem;
    }
    
    .form-container {
        margin: 0 0.5rem;
        padding: 1rem;
    }
    
    .main-header {
        padding: 0.75rem;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .btn {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .book-card {
        border-radius: 4px;
    }
}

/* Admin Panel Additional Enhancements */
.dashboard {
    animation: fadeIn 0.5s ease;
}

.stat-card {
    animation: slideUp 0.6s ease backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

.book-card {
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Table Enhancements */
.table {
    animation: fadeIn 0.5s ease;
}

.table tbody tr {
    transition: all 0.25s ease;
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Button Improvements */
.btn {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.96);
}

/* Form Focus States */
.form-control:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Loading Animation for Tables */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animasyonlar */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Özel Scrollbar - Black & White */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Public Sayfalar için Stiller */
.public-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Public Header - Ultra Minimal */
.public-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo h1 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0;
}

.logo h1 a {
    color: var(--text-primary);
    text-decoration: none;
    font-family: 'Playpen Sans', cursive;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.logo h1 a:hover {
    color: var(--accent-primary);
    transform: scale(1.05);
}

.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1rem;
    align-items: center;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
}

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

.admin-link {
    background: var(--accent-primary) !important;
    color: var(--bg-primary) !important;
    padding: 0.5rem 1rem !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
}

.admin-link:hover {
    background: var(--accent-secondary) !important;
    color: var(--bg-primary) !important;
}

/* Hero Section - Ultra Minimal */
.hero {
    background: var(--bg-primary);
    padding: 2rem 0 1rem;
    border-bottom: 1px solid var(--border-color);
}

.hero-content h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 400;
}

/* Books Section - Ultra Minimal */
.books-section {
    padding: 2rem 0;
    background: var(--bg-primary);
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding-right: 3rem;
}

.search-box i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

/* Book Overlay */
.book-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    cursor: pointer;
}

.book-info .author {
    color: var(--accent-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.book-info .genre {
    color: var(--accent-primary);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.no-books {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.no-books h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Footer - Minimal */
.public-footer {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    margin-top: auto;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.85rem;
}

/* Public Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .search-box {
        width: 100%;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Admin Panel Düzeltmeleri */
.admin-container .sidebar {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-right: 1px solid var(--border-color);
}

.admin-container .sidebar-header {
    border-bottom: 1px solid var(--border-color);
}

.admin-container .sidebar-nav a {
    color: var(--text-secondary);
}

.admin-container .sidebar-nav a:hover,
.admin-container .sidebar-nav a.active {
    background-color: var(--bg-tertiary);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
}

/* Public Container Düzeltmeleri */
.public-container {
    background: var(--bg-secondary);
}

/* Genel Form Düzeltmeleri */
.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary), 0.1);
}

/* Button Hover Efektleri */
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Card Hover Efektleri */
.stat-card:hover,
.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Book Detail Page Styles */
.book-detail {
    padding: 2rem 0;
}

.book-header {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.book-cover-large {
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.book-cover-large img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.no-cover-large {
    width: 100%;
    height: 100%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-tertiary);
}

.book-info-large h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 500;
    line-height: 1.2;
}

.book-meta-large {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.book-meta-large span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.description p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Chapters Section */
.chapters-section {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.chapters-section h2 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

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

.chapter-item {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chapter-item:hover {
    border-color: var(--accent-primary);
}

.chapter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.chapter-header:hover {
    background: var(--bg-secondary);
}

.chapter-header h3 {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    margin: 0;
}

.chapter-number {
    color: var(--accent-primary);
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 0.75rem;
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.chapter-toggle {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.chapter-toggle:hover {
    background: var(--bg-secondary);
}

.chapter-content {
    padding: 1.5rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Book Navigation */
.book-navigation {
    text-align: center;
    padding: 2rem 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: var(--accent-secondary);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

/* Responsive Design for Book Detail */
@media (max-width: 768px) {
    .book-header {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .book-cover-large {
        margin: 0 auto;
        max-width: 100%;
    }
    
    .book-cover-large img {
        height: auto;
        object-fit: contain;
    }
    
    .book-info-large h1 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .book-meta-large {
        justify-content: center;
    }
    
    .chapters-section {
        padding: 1.5rem;
    }
    
    .chapter-header {
        padding: 1rem;
    }
    
    .chapter-content {
        padding: 1rem;
    }
}

/* Chapter Reader Styles */
.chapter-reader {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.chapter-reader-header {
    margin-bottom: 3rem;
    text-align: center;
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--accent-secondary);
}

.breadcrumb i {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.chapter-reader-header h1 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 500;
    line-height: 1.3;
}

.chapter-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.chapter-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.chapter-views {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0.5rem 1rem;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.chapter-views i {
    font-size: 0.9rem;
    opacity: 0.7;
}

.chapter-content-reader {
    background: var(--bg-primary);
    padding: 3rem;
    border-radius: 15px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-medium);
    margin-bottom: 3rem;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    transition: border-color 0.3s ease;
    /* Kopyalama koruması */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.chapter-content-reader:hover {
    border-color: var(--accent-primary);
}

.chapter-navigation {
    margin: 3rem 0;
}

.nav-buttons {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

.nav-btn:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.prev-btn {
    justify-self: start;
}

.next-btn {
    justify-self: end;
}

.book-btn {
    justify-self: center;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.nav-btn div {
    display: flex;
    flex-direction: column;
}

.nav-btn small {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 0.25rem;
}

.nav-btn span {
    font-weight: 600;
}

.chapter-list-sidebar {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-medium);
    margin-top: 2rem;
}

.chapter-list-sidebar h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.chapter-list-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chapter-list-sidebar li {
    margin-bottom: 0.5rem;
}

.chapter-list-sidebar a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.chapter-list-sidebar a:hover,
.chapter-list-sidebar li.active a {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.chapter-num {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    min-width: 80px;
}

.chapter-title {
    font-weight: 500;
}

/* Responsive Chapter Reader */
@media (max-width: 768px) {
    .chapter-reader {
        padding: 1rem;
    }
    
    .chapter-reader-header h1 {
        font-size: 2rem;
    }
    
    .chapter-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .chapter-content-reader {
        padding: 2rem;
    }
    
    .nav-buttons {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .prev-btn,
    .next-btn,
    .book-btn {
        justify-self: stretch;
    }
    
    .breadcrumb {
        flex-wrap: wrap;
    }
}

/* Simple Editor Styles */
.editor-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    border-bottom: none;
}

.toolbar-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.toolbar-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.toolbar-btn:active {
    transform: translateY(0);
}

.editor-textarea {
    border-radius: 0 0 8px 8px !important;
    border-top: none !important;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    resize: vertical;
    min-height: 300px;
}

.editor-help {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.editor-help strong {
    color: var(--text-primary);
}

/* Responsive Editor */
@media (max-width: 768px) {
    .editor-toolbar {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .toolbar-btn {
        min-width: 32px;
        height: 32px;
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Line-based Comment System Styles */
.line-container {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    padding: 0.25rem 1rem;
    position: relative;
    background: transparent;
    line-height: 1.6;
}


.line-content {
    flex: 1;
    line-height: 1.6;
    color: var(--text-primary);
    font-size: 1rem;
    padding-right: 4rem;
}

.line-comment-section {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    opacity: 1;
    pointer-events: all;
}


.line-comment-section > * {
    transition: all 0.3s ease;
}

.empty-line {
    height: 0.5rem;
    margin-bottom: 0.25rem;
}

/* Line Comment Button - Icon Only Design */
.line-comment-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: var(--text-tertiary);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: visible;
    width: 36px;
    height: 36px;
}


.line-comment-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.line-comment-btn:active {
    transform: translateY(0) scale(1.05);
    transition: all 0.1s ease;
}

.line-comment-btn i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.line-comment-btn:hover i {
    transform: rotate(10deg) scale(1.1);
}

.line-comment-count {
    background: linear-gradient(135deg, var(--accent-primary), var(--text-primary));
    color: var(--bg-primary);
    padding: 0;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    width: 18px;
    height: 18px;
    text-align: center;
    display: none;
    line-height: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    animation: pulse 2s infinite;
    position: absolute;
    top: -2px;
    right: -2px;
    z-index: 10;
}

.line-comment-count.has-comments {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.line-comment-count::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, var(--accent-primary), var(--text-primary), var(--accent-primary));
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.line-comment-count:hover::after {
    opacity: 1;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Show comment count always when there are comments */
.line-container .line-comment-section {
    opacity: 1;
    pointer-events: all;
}

/* Dark theme specific styles */
[data-theme="dark"] .line-comment-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

[data-theme="dark"] .line-comment-btn:hover {
    background: var(--accent-primary);
    color: var(--text-primary);
}

/* Legacy comment button for compatibility */
.comment-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

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

.comment-count {
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    display: none;
}

.comment-count.has-comments {
    display: inline-block;
}

.comments-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.comments-list {
    margin-bottom: 1rem;
}

.comment-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

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

.comment-author {
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 500;
}

.comment-date {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.comment-text {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.no-comments {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
}

.add-comment {
    display: grid;
    gap: 0.75rem;
}

.comment-input,
.comment-textarea {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
}

.comment-input:focus,
.comment-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.comment-textarea {
    resize: vertical;
    min-height: 60px;
}

/* Responsive Line Comments */
@media (max-width: 768px) {
    .line-container {
        margin-bottom: 0.4rem;
        padding: 0.2rem 0.5rem;
    }
    
    
    .line-comment-section {
        right: 0.5rem;
        opacity: 1;
        transform: translateY(-50%);
        pointer-events: all;
        gap: 0.4rem;
    }
    
    .line-comment-btn {
        padding: 0.4rem;
        font-size: 0.85rem;
        width: 32px;
        height: 32px;
    }
    
    .line-comment-btn:hover {
        transform: translateY(-1px) scale(1.05);
    }
    
    
    .line-comment-count {
        min-width: 16px;
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
        line-height: 16px;
        top: -1px;
        right: -1px;
    }
    
    .line-content {
        padding-right: 5rem;
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    /* Disable animations on mobile for better performance */
    .line-comment-section > * {
        animation: none !important;
    }
    
    .comments-section {
        padding: 0.75rem;
    }
    
    .comment-item {
        padding: 0.5rem;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-heavy);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

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

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-comments-list {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.comments-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-comment-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.modal-comment-item:hover {
    border-color: var(--accent-primary);
}

.modal-comment-item .comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.modal-comment-item .comment-author {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.modal-comment-item .comment-date {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.modal-comment-item .comment-text {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.add-comment-form {
    padding-bottom: 1.5rem;
}

.add-comment-form h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}

.no-comments {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px dashed var(--border-color);
}

/* Comment Warning */
.comment-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.comment-warning i {
    color: #856404;
    font-size: 1.2rem;
    margin-top: 2px;
}

.comment-warning strong {
    color: #856404;
    display: block;
    margin-bottom: 4px;
}

.comment-warning > div {
    flex: 1;
}

.comment-warning p {
    color: #856404;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Dark Mode for Comment Warning */
[data-theme="dark"] .comment-warning {
    background: #3d2f00;
    border-color: #856404;
}

[data-theme="dark"] .comment-warning i,
[data-theme="dark"] .comment-warning strong,
[data-theme="dark"] .comment-warning p {
    color: #ffc107;
}

/* Modal Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Toast Notifications */
.toast {
    animation: toastSlideIn 0.3s ease;
}

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

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-comment-item {
        padding: 0.75rem;
    }
    
    .modal-comment-item .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* Chapter Management Styles */
.chapter-number-badge {
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.85rem;
}

.chapter-title {
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
}

.chapter-excerpt {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-published {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.status-draft {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Author Section Styles */
.author-section {
    margin: 3rem 0;
    padding: 3rem 0;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
}

.author-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

.author-photo {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

.author-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 4rem;
}

.author-info h3 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.author-info p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.author-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.author-actions .btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
}

/* Search and Filter Styles */
.search-filters {
    margin: 2rem 0;
    padding: 2rem;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: var(--shadow-light);
}

.search-form .search-row {
    display: grid;
    grid-template-columns: 1fr 200px auto;
    gap: 1rem;
    align-items: center;
}

.search-input {
    position: relative;
}

.search-input i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.search-input input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
}

.search-input input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.filter-select select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
}

.search-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.search-results-info p {
    margin: 0;
    color: var(--text-secondary);
}

.clear-filters {
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-filters:hover {
    color: var(--text-primary);
}

/* Enhanced Book Card Styles */
.book-card .author,
.book-card .genre {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.book-card .book-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 1rem;
}

.book-card .book-meta span {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Navigation Enhancement */
.main-nav ul {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.main-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Responsive Design for Author Section */
@media (max-width: 768px) {
    .author-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
        padding: 0 1rem;
    }
    
    .author-photo {
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }
    
    .author-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .search-form .search-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .search-results-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

