/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    color: #334155;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    background: #ffffff;
    padding: 0;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #f1f5f9;
}

header h1 {
    color: #1e293b;
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #64748b;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Navigation */
nav {
    display: flex;
    padding: 0 20px;
    background: #f8fafc;
}

.nav-btn {
    padding: 16px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s ease;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.nav-btn:hover {
    background: rgba(59, 130, 246, 0.05);
    color: #3b82f6;
}

.nav-btn.active {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* Sections */
.section {
    display: none;
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-box {
    position: relative;
    width: 250px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box .icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

/* Stats */
.stats-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 24px;
}

.stat-card {
    background: #f8fafc;
    padding: 16px 20px;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e293b;
}

.stat-label {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 4px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* Grid List */
.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card h3 {
    color: #1e293b;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.card p {
    color: #64748b;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.card-actions {
    padding: 16px;
    display: flex;
    gap: 10px;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
}

.card-actions button {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
}

/* FULLSCREEN MODAL STYLES - FOR BOOK MODAL ONLY */
.fullscreen-modal {
    width: 95% !important;
    max-width: 95% !important;
    height: 95vh !important;
    margin: 2.5vh auto !important;
    max-height: 95vh !important;
}

.fullscreen-form {
    padding: 0 !important;
    height: calc(95vh - 80px) !important;
    display: flex !important;
    flex-direction: column !important;
}

.form-scrollable-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    padding-right: 25px;
}

.form-actions-fullscreen {
    margin-top: auto !important;
    padding: 25px 30px !important;
    border-top: 3px solid #8B4513 !important;
    background: white !important;
    display: flex !important;
    gap: 15px !important;
    position: sticky !important;
    bottom: 0 !important;
}

.form-actions-fullscreen button {
    flex: 1;
    padding: 15px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}

/* BROWN THEME FOR BOOK MODAL */
.brown-title {
    color: #8B4513 !important;
    font-weight: 700 !important;
}

.brown-label {
    color: #654321 !important;
    font-weight: 600 !important;
}

.brown-section {
    background: #FFF8F0 !important;
    padding: 25px !important;
    border-radius: 12px !important;
    margin-bottom: 25px !important;
    border: 2px solid #D2B48C !important;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.1) !important;
}

.brown-section h4 {
    color: #8B4513 !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    margin-bottom: 20px !important;
    padding-bottom: 12px !important;
    border-bottom: 3px solid #D2B48C !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.brown-button {
    background: linear-gradient(135deg, #8B4513, #A0522D) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3) !important;
}

.brown-button:hover {
    background: linear-gradient(135deg, #A0522D, #8B4513) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4) !important;
}

.brown-info {
    background: #FFF8F0 !important;
    border: 2px solid #D2B48C !important;
    border-radius: 10px !important;
    padding: 20px !important;
}

.brown-info p {
    color: #654321 !important;
    font-weight: 600 !important;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #f1f5f9;
}

.modal-header h3 {
    color: #1e293b;
    font-size: 1.3rem;
    font-weight: 600;
}

.close {
    color: #94a3b8;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #475569;
}

/* Form Styles */
form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.half-width {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    background: #f8fafc;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #ffffff;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.form-actions button {
    flex: 1;
}

/* Image Preview */
.image-preview {
    margin-top: 10px;
    text-align: center;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Loading and Error */
.loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-size: 16px;
    grid-column: 1 / -1;
}

.error {
    text-align: center;
    padding: 40px;
    color: #dc2626;
    font-size: 16px;
    grid-column: 1 / -1;
}

/* Form Info */
.form-info {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 12px 15px;
    margin: 15px 0;
}

.form-info p {
    margin: 0;
    color: #1e40af;
    font-size: 0.9rem;
}

.form-hint {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 0.85rem;
}

/* File Upload */
.file-upload-container {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-upload-container input[type="file"] {
    position: absolute;
    left: -9999px;
}

.file-upload-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    justify-content: center;
    color: #475569;
    font-size: 0.9rem;
}

.file-upload-label:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* Radio and Checkbox */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.radio-option input {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    transition: all 0.3s ease;
}

.radio-option input:checked + .radio-custom {
    border-color: #3b82f6;
}

.radio-option input:checked + .radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-option input {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    display: inline-block;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-option input:checked + .checkbox-custom {
    background: #3b82f6;
    border-color: #3b82f6;
}

.checkbox-option input:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.icon {
    font-style: normal;
}

/* Consistent Section Design */
.form-section {
    background: #FFF8F0 !important;
    padding: 25px !important;
    border-radius: 12px !important;
    margin-bottom: 25px !important;
    border: 2px solid #D2B48C !important;
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.1) !important;
}

.form-section h4 {
    color: #8B4513 !important;
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    margin-bottom: 20px !important;
    padding-bottom: 12px !important;
    border-bottom: 3px solid #D2B48C !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.form-section .form-group {
    margin-bottom: 20px !important;
}

.form-section .brown-label {
    color: #654321 !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    margin-bottom: 8px !important;
    display: block !important;
}

.form-section input,
.form-section select,
.form-section textarea {
    background: #ffffff !important;
    border: 1px solid #D2B48C !important;
    border-radius: 8px !important;
    padding: 12px 15px !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
}

.form-section input:focus,
.form-section select:focus,
.form-section textarea:focus {
    border-color: #8B4513 !important;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1) !important;
    outline: none !important;
}

/* Radio and Checkbox in Sections */
.form-section .radio-group,
.form-section .checkbox-option {
    margin-top: 10px !important;
}

.form-section .radio-option,
.form-section .checkbox-option {
    color: #654321 !important;
    font-weight: 500 !important;
}

/* File Upload in Sections */
.form-section .file-upload-label {
    background: #ffffff !important;
    border: 1px dashed #D2B48C !important;
    color: #654321 !important;
    transition: all 0.3s ease !important;
}

.form-section .file-upload-label:hover {
    background: #FFF8F0 !important;
    border-color: #8B4513 !important;
}

/* Form Hints in Sections */
.form-section .form-hint {
    color: #8B4513 !important;
    font-size: 0.85rem !important;
    margin-top: 5px !important;
    display: block !important;
}

/* Image Preview in Sections */
.form-section .image-preview img {
    border: 2px solid #D2B48C !important;
    border-radius: 8px !important;
}

/* Delete Button in Sections */
.form-section .delete-image-btn {
    background: #dc2626 !important;
    color: white !important;
    border: none !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    margin-left: 10px !important;
    transition: all 0.3s ease !important;
}

.form-section .delete-image-btn:hover {
    background: #b91c1c !important;
    transform: translateY(-1px) !important;
}

/* Scrollbar for scrollable content */
.form-scrollable-content::-webkit-scrollbar {
    width: 12px;
}

.form-scrollable-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 6px;
}

.form-scrollable-content::-webkit-scrollbar-thumb {
    background: #D2B48C;
    border-radius: 6px;
    border: 3px solid #f1f5f9;
}

.form-scrollable-content::-webkit-scrollbar-thumb:hover {
    background: #8B4513;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    nav {
        flex-direction: column;
    }
    
    .nav-btn {
        justify-content: center;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
    }
    
    .stats-bar {
        flex-direction: column;
    }
    
    .grid-list {
        grid-template-columns: 1fr;
    }
    
    .fullscreen-modal {
        width: 100% !important;
        height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    
    .form-scrollable-content {
        padding: 20px;
    }
    
    .form-actions-fullscreen {
        flex-direction: column;
        padding: 20px !important;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}