/* Database Modal Styles */
.db-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6); /* Slate-900 with opacity */
    backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.db-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.db-modal-container {
    background: transparent; /* Handled by Tailwind classes in HTML */
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.db-modal-backdrop.active .db-modal-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Modal Header */
.db-modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(241, 245, 249, 0.6); /* Transparent border */
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: start;
    background: transparent; /* Changed from white to transparent */
    z-index: 10;
}

.db-modal-title-group {
    padding-right: 2rem;
}

.db-modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.db-modal-close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f8fafc;
    color: #64748b;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid #e2e8f0;
}

.db-modal-close-btn:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    transform: rotate(90deg);
}

/* Modal Content */
.db-modal-content {
    padding: 1.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Modal Sections */
.db-modal-section {
    margin-bottom: 1.5rem;
}

.db-modal-section:last-child {
    margin-bottom: 0;
}

.db-modal-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.db-modal-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334155;
}

/* Elements Grid in Modal */
.db-modal-elements {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.db-modal-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* Publication Card */
.db-modal-pub-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 1rem;
    padding: 1rem;
}

.db-modal-pub-title {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.db-modal-pub-journal {
    font-style: italic;
    color: #64748b;
    font-size: 0.875rem;
}

/* Modal Footer */
.db-modal-footer {
    padding: 1rem 1.5rem;
    background: transparent;
    border-top: 1px solid rgba(226, 232, 240, 0.4);
    flex-shrink: 0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.db-modal-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    text-decoration: none;
    cursor: pointer;
    min-width: 140px;
}

.db-modal-btn-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.2);
    border: 1px solid transparent;
}

.db-modal-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(14, 165, 233, 0.3);
    filter: brightness(1.05);
}

.db-modal-btn-secondary {
    background: white;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.db-modal-btn-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

/* Responsive */
@media (max-width: 640px) {
    .db-modal-footer {
        flex-direction: column;
    }
    
    .db-modal-btn {
        width: 100%;
    }
}
