/* library.css */

/* Search input focus */
#searchLibrary:focus {
    border-color: #146c94 !important;
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(20, 108, 148, 0.2) !important;
}

/* Placeholder styling */
#searchLibrary::placeholder {
    color: #9ca3af !important;
    opacity: 0.6;
}

/* Advanced Filter Panel */
#advancedFilterPanel {
    overflow: hidden;
}

#advancedFilterPanel.hidden {
    display: none;
}

/* Filter Arrow Rotation */
#filterArrow.rotated {
    transform: rotate(180deg);
}

/* Category checkbox labels */
.category-checkbox:checked + i + span,
.category-checkbox:checked ~ span {
    color: #146c94;
    font-weight: 600;
}

label:has(.category-checkbox:checked) {
    border-color: rgba(20, 108, 148, 0.5) !important;
    background: linear-gradient(
        135deg,
        rgba(20, 108, 148, 0.05),
        rgba(25, 167, 206, 0.05)
    ) !important;
}

/* Radio buttons styling */
.search-radio:checked {
    background-color: #146c94;
    border-color: #146c94;
}

/* Table row hover */
#libraryTableBody tr:hover {
    transform: translateY(-1px);
}

/* Download and view buttons */
.download-btn,
.view-btn {
    cursor: pointer;
}

.download-btn:active,
.view-btn:active {
    transform: scale(0.95) translateY(-1px) !important;
}

/* Active nav indicator for library */
nav a[href="library"] {
    position: relative;
}

nav a[href="library"]::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, #146c94, #19a7ce);
    border-radius: 3px 3px 0 0;
}

/* Checkbox styling */
input[type="checkbox"] {
    cursor: pointer;
}

input[type="checkbox"]:checked {
    background-color: #146c94;
    border-color: #146c94;
}

/* View Modal Styles */
.view-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}

.view-modal-content {
    background: white;
    border-radius: 1.5rem;
    width: 100%;
    max-width: 900px;
    height: 85vh;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.view-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #f3f4f6;
    background: linear-gradient(
        135deg,
        rgba(20, 108, 148, 0.05),
        rgba(25, 167, 206, 0.05)
    );
    flex-shrink: 0;
}

.view-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.view-modal-body::-webkit-scrollbar {
    width: 8px;
}

.view-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.view-modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #146c94, #19a7ce);
    border-radius: 4px;
}

.view-modal-body::-webkit-scrollbar-thumb:hover {
    background: #146c94;
}

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

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

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

.animate-slideIn {
    animation: slideIn 0.3s ease-out;
}

.animate-modalSlideIn {
    animation: modalSlideIn 0.3s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    #advancedFilterToggle {
        width: 100%;
    }

    .view-modal-content {
        height: 95vh;
        max-height: 95vh;
        border-radius: 1rem;
    }

    .view-modal-header {
        padding: 1rem 1.5rem;
    }

    .view-modal-body {
        padding: 1rem;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.animate-fadeOut {
    animation: fadeOut 0.2s ease-out forwards;
}
