/* Google Fonts - Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.rsdi-container {
    font-family: 'Inter', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    color: #1f2937;
}

.rsdi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.rsdi-title {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.rsdi-search-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
    min-width: 250px;
}

.rsdi-search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 9999px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.rsdi-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.rsdi-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.1rem;
}

.rsdi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Card Design - Compact & Modern */
.rsdi-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    z-index: 1;
    cursor: pointer;
    min-height: 160px;
}

.rsdi-card-image {
    width: 100%;
    height: 130px;
    background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.3s ease;
    overflow: hidden;
}

.rsdi-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    max-width: none !important;
    border-radius: 16px 16px 0 0;
}

.rsdi-placeholder-icon {
    width: 48px;
    height: 48px;
    color: #818cf8;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.rsdi-card:hover .rsdi-card-image {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
}

.rsdi-card:hover .rsdi-placeholder-icon {
    transform: scale(1.1);
}

.rsdi-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.rsdi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rsdi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    border-color: #e5e7eb;
}

.rsdi-card:hover::before {
    opacity: 1;
}

.rsdi-sigla-badge {
    align-self: flex-start;
    background: #eff6ff;
    color: #2563eb;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    border: 1px solid #bfdbfe;
}

.rsdi-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

.rsdi-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.rsdi-view-details {
    font-size: 0.85rem;
    font-weight: 600;
    color: #3b82f6;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}

.rsdi-card:hover .rsdi-view-details {
    color: #2563eb;
}

.rsdi-view-details::after {
    content: '→';
    transition: transform 0.2s;
}

.rsdi-card:hover .rsdi-view-details::after {
    transform: translateX(4px);
}

.rsdi-no-results {
    text-align: center;
    padding: 3rem;
    background: #f9fafb;
    border-radius: 1rem;
    color: #6b7280;
    font-size: 1.1rem;
}

/* Modal Styles */
.rsdi-modal {
    display: none; 
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rsdi-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.rsdi-modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 2.5rem;
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.rsdi-modal.show .rsdi-modal-content {
    transform: scale(1) translateY(0);
}

.rsdi-modal-close {
    color: #9ca3af;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.75rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f4f6;
    transition: all 0.2s;
}

.rsdi-modal-close:hover {
    color: #1f2937;
    background: #e5e7eb;
}

.rsdi-modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
    margin: 0.5rem 0 1.5rem 0;
    line-height: 1.3;
}

.rsdi-modal-area {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.rsdi-modal-area .rsdi-area-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #e0e7ff;
    color: #4f46e5;
    border-radius: 10px;
    margin-right: 1rem;
    font-size: 1.2rem;
}

.rsdi-modal-area span {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
}

.rsdi-modal-subtitle {
    font-size: 1.1rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 0.75rem 0;
}

.rsdi-modal-desc {
    font-size: 1rem;
    color: #4b5563;
    line-height: 1.7;
    margin: 0;
    white-space: pre-wrap; /* Respeta saltos de línea del Excel */
}

/* Fade in animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.rsdi-animate-in {
    animation: fadeIn 0.4s ease-out forwards;
    opacity: 0;
}

@media (max-width: 640px) {
    .rsdi-header {
        flex-direction: column;
        align-items: stretch;
    }
    .rsdi-search-wrapper {
        max-width: 100%;
    }
    .rsdi-modal-content {
        padding: 1.5rem;
        width: 95%;
    }
}
