/* Admin Interface Styles */

/* Login Screen */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box .form-control {
    padding: 0.75rem;
}

/* Admin Layout */
.admin-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

.admin-sidebar {
    width: 250px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    padding: 1.5rem 0;
}

.admin-sidebar .nav-link {
    color: #495057;
    padding: 0.75rem 1.5rem;
    margin-bottom: 0.25rem;
    border-left: 3px solid transparent;
    transition: all 0.3s;
}

.admin-sidebar .nav-link:hover {
    background: #e9ecef;
    color: #212529;
}

.admin-sidebar .nav-link.active {
    color: #8B4513;
    background: #fff;
    border-left-color: #8B4513;
    font-weight: 600;
}

.admin-sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 20px;
    display: inline-block;
}

.admin-content {
    flex: 1;
    padding: 2rem;
    background: #f8f9fa;
    overflow-y: auto;
}

/* Statistics Cards */
.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    transition: transform 0.3s;
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-right: 1rem;
}

.stat-info h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: bold;
    color: #212529;
}

.stat-info p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Tables */
.table-responsive {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8f9fa;
    border-top: none;
    font-weight: 600;
    color: #495057;
    padding: 1rem;
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    background: #f8f9fa;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

/* Forms */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #8B4513;
    box-shadow: 0 0 0 0.2rem rgba(139, 69, 19, 0.25);
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #8B4513;
    background: #fff;
}

.upload-zone i {
    color: #6c757d;
}

.upload-zone p {
    margin: 0.5rem 0 0 0;
    color: #6c757d;
}

/* Image Preview */
.image-preview {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.5rem;
    background: white;
}

.image-preview img {
    border-radius: 4px;
    max-height: 150px;
    object-fit: cover;
    width: 100%;
}

.image-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.image-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.image-card img {
    border-radius: 4px;
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #f8f9fa;
}

/* Modals */
.modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.modal-xl .modal-body {
    padding: 2rem;
}

/* Buttons */
.btn-primary {
    background-color: #8B4513;
    border-color: #8B4513;
}

.btn-primary:hover {
    background-color: #723a0f;
    border-color: #723a0f;
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(139, 69, 19, 0.5);
}

.btn-outline-primary {
    color: #8B4513;
    border-color: #8B4513;
}

.btn-outline-primary:hover {
    background-color: #8B4513;
    border-color: #8B4513;
    color: white;
}

/* Pagination */
.pagination {
    margin-top: 1.5rem;
}

.pagination .page-link {
    color: #8B4513;
}

.pagination .page-item.active .page-link {
    background-color: #8B4513;
    border-color: #8B4513;
    color: white;
}

.pagination .page-link:hover {
    background-color: #723a0f;
    border-color: #723a0f;
    color: white;
}

/* Badges */
.badge {
    padding: 0.35rem 0.65rem;
    font-weight: 500;
}

/* Toasts */
.toast {
    min-width: 300px;
}

.toast-header {
    border-bottom: none;
}

/* Activity List */
#recentActivity li {
    padding: 0.75rem;
    border-left: 3px solid #e9ecef;
    margin-left: 1rem;
}

#recentActivity li:hover {
    background: #f8f9fa;
    border-left-color: #8B4513;
}

/* Content View */
.content-view {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }

    .admin-content {
        padding: 1rem;
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    .table-thumbnail {
        width: 40px;
        height: 40px;
    }

    .login-box {
        margin: 1rem;
        padding: 2rem;
    }
}

/* Utilities */
.text-muted {
    color: #6c757d !important;
}

.metadata-table td {
    padding: 0.5rem;
    vertical-align: top;
}

.metadata-table td:first-child {
    font-weight: 500;
    width: 150px;
    color: #495057;
}

/* Loading States */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15rem;
}

/* Required Field Indicator */
.text-danger {
    color: #dc3545 !important;
}

/* Form Help Text */
.form-text {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Search and Filter Section */
.card-body .row.g-3 {
    align-items: center;
}

/* Empty State */
.text-center.text-muted.py-4 {
    padding: 3rem 1rem !important;
    color: #adb5bd !important;
}

/* Collections Sidebar */
.collections-section {
    margin-bottom: 0.5rem;
}

.collections-toggle {
    cursor: pointer;
    user-select: none;
}

.collections-toggle i.float-end {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.collections-toggle.collapsed i.float-end {
    transform: rotate(-90deg);
}

.collections-submenu {
    max-height: 600px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.collections-submenu.collapsed {
    max-height: 0;
    opacity: 0;
}

.nav-link-sm {
    font-size: 0.9rem;
    padding: 0.5rem 1.5rem 0.5rem 2.5rem !important;
}

.nav-link-sm i {
    font-size: 0.85rem;
}

.collections-submenu small.text-muted {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Collection Table Styles */
#collectionTable thead th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
}

#collectionTable tbody tr {
    cursor: pointer;
}

#collectionTable .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Collection Form Styles */
#collectionItemForm .form-control,
#collectionItemForm .form-select,
#collectionItemForm textarea {
    font-size: 0.95rem;
}

#collectionItemForm textarea {
    min-height: 100px;
    resize: vertical;
}

/* Literature Tags (for tile form) */
.literature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: #f8f9fa;
    min-height: 60px;
}

.literature-tag {
    display: inline-flex;
    align-items: center;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.literature-tag:hover {
    border-color: #8B4513;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.literature-tag .remove-tag {
    margin-left: 0.5rem;
    cursor: pointer;
    color: #dc3545;
    font-weight: bold;
}

.literature-tag .remove-tag:hover {
    color: #a71d2a;
}

/* Cascading Dropdown Feedback */
.form-select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.dropdown-help-text {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 0.25rem;
}

/* Dimensions Input Group */
.dimensions-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.dimensions-group input[type="number"] {
    width: 100%;
}

/* Warning Alerts in Forms */
.form-warning {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.form-warning i {
    margin-right: 0.5rem;
    color: #856404;
}

/* Delete Protection Modal */
.delete-protection-warning {
    background-color: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.delete-protection-warning i {
    color: #842029;
    font-size: 1.5rem;
    margin-right: 0.75rem;
}
