/**
 * =====================================================
 * ATLAS MEDICAL LIBRARY - STYLES
 * =====================================================
 *
 * Estilos para el navegador de biblioteca médica
 *
 * @project Doctores.cloud
 * @founder Rodolfo Gallegos L.
 * =====================================================
 */

/* Library Window Container */
.atlas-medical-library {
    position: fixed;
    top: 0;
    right: -700px;
    width: 700px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.atlas-medical-library.open {
    right: 0;
}

/* Overlay */
.atlas-library-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.atlas-library-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Header */
.library-header {
    background: linear-gradient(135deg, #059669 0%, #10B981 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(5, 150, 105, 0.2);
}

.library-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.library-header-left i {
    font-size: 24px;
}

.library-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.library-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.library-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.library-close-btn i {
    font-size: 18px;
}

/* Toolbar */
.library-toolbar {
    padding: 20px;
    border-bottom: 1px solid #E5E7EB;
    background: #F9FAFB;
}

.library-search {
    position: relative;
    margin-bottom: 15px;
}

.library-search i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 16px;
}

.library-search input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.library-search input:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.library-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    flex: 1;
    min-width: 80px;
    padding: 10px 15px;
    border: 2px solid #E5E7EB;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #6B7280;
}

.filter-btn:hover {
    border-color: #10B981;
    color: #10B981;
    background: #F0FDF4;
}

.filter-btn.active {
    border-color: #10B981;
    background: #10B981;
    color: white;
}

.filter-btn i {
    font-size: 14px;
}

/* Stats */
.library-stats {
    padding: 12px 20px;
    background: white;
    border-bottom: 1px solid #E5E7EB;
    color: #6B7280;
    font-size: 14px;
    font-weight: 500;
}

/* Content Area */
.library-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #F9FAFB;
}

.library-content::-webkit-scrollbar {
    width: 8px;
}

.library-content::-webkit-scrollbar-track {
    background: #F3F4F6;
}

.library-content::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}

.library-content::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Placeholder */
.library-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9CA3AF;
    text-align: center;
    padding: 40px;
}

.library-placeholder i {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.library-placeholder p {
    margin: 8px 0;
    font-size: 16px;
}

.library-placeholder-subtitle {
    font-size: 14px !important;
    opacity: 0.7;
}

/* Library Entry */
.library-entry {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
}

.library-entry:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.library-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.library-entry-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.library-entry-title i {
    color: #10B981;
    font-size: 18px;
}

.library-entry-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1E293B;
    line-height: 1.4;
}

.library-entry-actions {
    display: flex;
    gap: 8px;
}

.library-entry-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: #F3F4F6;
    color: #6B7280;
}

.library-entry-btn:hover {
    transform: scale(1.1);
}

.library-entry-btn.view-btn:hover {
    background: #DBEAFE;
    color: #3B82F6;
}

.library-entry-btn.delete-btn:hover {
    background: #FEE2E2;
    color: #EF4444;
}

.library-entry-btn i {
    font-size: 14px;
}

.library-entry-snippet {
    color: #6B7280;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.library-entry-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid #F3F4F6;
}

.library-entry-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #9CA3AF;
}

.library-entry-meta-item i {
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .atlas-medical-library {
        width: 100%;
        right: -100%;
    }

    .atlas-medical-library.open {
        right: 0;
    }

    .library-filters {
        flex-direction: column;
    }

    .filter-btn {
        flex: none;
        width: 100%;
    }

    .library-entry-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* Animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.library-entry {
    animation: slideInRight 0.3s ease backwards;
}

.library-entry:nth-child(1) { animation-delay: 0.05s; }
.library-entry:nth-child(2) { animation-delay: 0.1s; }
.library-entry:nth-child(3) { animation-delay: 0.15s; }
.library-entry:nth-child(4) { animation-delay: 0.2s; }
.library-entry:nth-child(5) { animation-delay: 0.25s; }
