/* Estilos generales */
.hgw-biblioteca {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.hgw-biblioteca h1 {
    font-size: 2rem!important;
    color: #1a1a1a;
    margin-bottom: 20px;
    border-bottom: 3px solid #0073aa;
    padding-bottom: 10px;
    display: inline-block;
}

/* Barra de búsqueda */
.hgw-biblioteca .hgw-search-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.hgw-biblioteca .hgw-search-form label {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.hgw-biblioteca .hgw-search-form .hgw-search-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.hgw-biblioteca .hgw-search-form input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.hgw-biblioteca .hgw-search-form input[type="text"]:focus {
    border-color: #0073aa;
    outline: none;
}

.hgw-biblioteca .hgw-search-form button {
    padding: 12px 30px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hgw-biblioteca .hgw-search-form button:hover {
    background: #005a87;
}

/* Notificaciones */
.hgw-notice {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.hgw-notice.info {
    background: #e7f3ff;
    border-left: 5px solid #0073aa;
    color: #004d73;
}

.hgw-notice.success {
    background: #d4edda;
    border-left: 5px solid #28a745;
    color: #155724;
}

.hgw-notice.warning {
    background: #fff3cd;
    border-left: 5px solid #ffc107;
    color: #856404;
}

.hgw-notice a {
    color: #0073aa;
    font-weight: 600;
}

.hgw-notice a:hover {
    text-decoration: underline;
}

/* Grid de tarjetas */
.hgw-resultados {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* Tarjeta individual */
.hgw-recurso {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.hgw-recurso:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.hgw-recurso .hgw-recurso-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.hgw-recurso h3 {
    margin: 0;
    font-size: 1.2rem!important;
    color: #1a1a1a;
    flex: 1;
}

.hgw-recurso .hgw-badge {
    background: #0073aa;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem!important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    margin-left: 10px;
    align-self: flex-start;
}

.hgw-recurso .hgw-badge.youtube {
    background: #ff0000;
}

.hgw-recurso .hgw-badge.googledrive {
    background: #0b57d0;
}

.hgw-recurso .hgw-badge.pdf {
    background: #ad1f2d;
}

.hgw-recurso .hgw-badge.video {
    background: #6f42c1;
}

.hgw-recurso .hgw-badge.imagen {
    background: #28a745;
}

.hgw-recurso .hgw-badge.audio {
    background: #fd7e14;
}

.hgw-recurso .hgw-descripcion {
    color: #495057;
    margin: 8px 0 12px 0;
    font-size: 0.95rem!important;
    line-height: 1.3;
    flex-grow: 1;
}

.hgw-recurso .hgw-tags {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hgw-recurso .hgw-tag {
    background: #f1f3f5;
    color: #495057;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem!important;
    font-weight: 500;
}

.hgw-recurso .hgw-productos {
    margin: 6px 0 12px 0;
    font-size: 0.9rem!important;
    line-height: 1.1;
    color: #495057;
}

.hgw-recurso .hgw-productos strong {
    color: #1a1a1a;
}

.hgw-recurso .hgw-accion {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.hgw-recurso .hgw-action-btn {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 8px 20px;
    border-radius: 6px;
    text-decoration: none!important;
    font-weight: 500;
    transition: background 0.2s;
    font-size: 0.9rem!important;
}

.hgw-recurso .hgw-action-btn:hover {
    background: #005a87;
}

.hgw-recurso .hgw-action-btn-disabled {
    display: inline-block;
    background: #e9ecef;
    color: #6c757d;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.9rem!important;
    cursor: not-allowed;
}

.hgw-recurso .hgw-login-btn {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 8px 20px;
    border-radius: 6px;
    text-decoration: none!important;
    font-weight: 500;
    transition: background 0.2s;
    font-size: 0.9rem!important;
}

.hgw-recurso .hgw-login-btn:hover {
    background: #005a87;
}

/* Mensaje cuando no hay resultados */
.hgw-no-resultados {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
    font-size: 1.1rem!important;
}

.hgw-paginacion {
    margin-top: 30px;
    text-align: center;
}
.hgw-paginacion a {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none!important;
    border-radius: 4px;
    border: 1px solid #ddd;
}
.hgw-paginacion a.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    text-decoration: none;
}
.hgw-paginacion a:hover {
    background: #e0e0e0;
}
.hgw-paginacion a.active:hover {
    background: #005a87;
}


/* Responsive */
@media (max-width: 768px) {
    .hgw-resultados {
        grid-template-columns: 1fr;
    }

    .hgw-biblioteca .hgw-search-form .hgw-search-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .hgw-biblioteca .hgw-search-form button {
        justify-content: center;
    }
}